summaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-03-16 16:27:49 +0000
committerDavid Howells <dhowells@redhat.com>2017-03-16 16:29:30 +0000
commitc5051c7bc777dffa5661569dec5997f432b9a34a (patch)
tree1a7e785c0feb49c4c83eea20ab00e24f99c7fca1 /fs/afs
parent65a151094edeb04e8f5f6f1502028e2383e81bb8 (diff)
downloadop-kernel-dev-c5051c7bc777dffa5661569dec5997f432b9a34a.zip
op-kernel-dev-c5051c7bc777dffa5661569dec5997f432b9a34a.tar.gz
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 <dhowells@redhat.com>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/write.c9
1 files changed, 4 insertions, 5 deletions
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;
}
OpenPOWER on IntegriCloud