Commit c5051c7b authored by David Howells's avatar David Howells

afs: Don't wait for page writeback with the page lock held

Drop the page lock before waiting for page writeback.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 65a15109
...@@ -518,17 +518,16 @@ static int afs_writepages_region(struct address_space *mapping, ...@@ -518,17 +518,16 @@ static int afs_writepages_region(struct address_space *mapping,
*/ */
lock_page(page); lock_page(page);
if (page->mapping != mapping) { if (page->mapping != mapping || !PageDirty(page)) {
unlock_page(page); unlock_page(page);
put_page(page); put_page(page);
continue; continue;
} }
if (PageWriteback(page)) {
unlock_page(page);
if (wbc->sync_mode != WB_SYNC_NONE) if (wbc->sync_mode != WB_SYNC_NONE)
wait_on_page_writeback(page); wait_on_page_writeback(page);
if (PageWriteback(page) || !PageDirty(page)) {
unlock_page(page);
put_page(page); put_page(page);
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment