Skip to content

Commit

Permalink
[PATCH] mpage_writepages() page locking fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nikita Danilov authored and Linus Torvalds committed May 1, 2005
1 parent 97e2bde commit 552fca4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/mpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,8 @@ __mpage_writepages(struct address_space *mapping,
&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)) {
Expand Down

0 comments on commit 552fca4

Please sign in to comment.