[PATCH] mpage_writepages() page locking fix
authorNikita Danilov <nikita@clusterfs.com>
Sun, 1 May 2005 15:58:39 +0000 (08:58 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 1 May 2005 15:58:39 +0000 (08:58 -0700)
When ->writepage() returns WRITEPAGE_ACTIVATE, the page is still locked.
Explicitly unlock the page in mpage_writepages().

Signed-off-by: Nikita Danilov <nikita@clusterfs.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/mpage.c

index e7d8d1a776061853f9dd2ab110ff1fc4067b9e21..3923facf94eb184b089e482ae3344a29b62f1eac 100644 (file)
@@ -727,6 +727,8 @@ retry:
                                                &last_block_in_bio, &ret, wbc,
                                                writepage_fn);
                        }
+                       if (unlikely(ret == WRITEPAGE_ACTIVATE))
+                               unlock_page(page);
                        if (ret || (--(wbc->nr_to_write) <= 0))
                                done = 1;
                        if (wbc->nonblocking && bdi_write_congested(bdi)) {