From: David Howells Date: Thu, 16 Mar 2017 16:27:49 +0000 (+0000) Subject: afs: Don't wait for page writeback with the page lock held X-Git-Tag: v4.14-rc1~1278^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5051c7bc777dffa5661569dec5997f432b9a34a;p=platform%2Fkernel%2Flinux-rpi.git afs: Don't wait for page writeback with the page lock held Drop the page lock before waiting for page writeback. Signed-off-by: David Howells --- diff --git a/fs/afs/write.c b/fs/afs/write.c index e5f150b..2d2fccd 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -518,17 +518,16 @@ static int afs_writepages_region(struct address_space *mapping, */ lock_page(page); - if (page->mapping != mapping) { + if (page->mapping != mapping || !PageDirty(page)) { unlock_page(page); put_page(page); continue; } - if (wbc->sync_mode != WB_SYNC_NONE) - wait_on_page_writeback(page); - - if (PageWriteback(page) || !PageDirty(page)) { + if (PageWriteback(page)) { unlock_page(page); + if (wbc->sync_mode != WB_SYNC_NONE) + wait_on_page_writeback(page); put_page(page); continue; }