summaryrefslogtreecommitdiff
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
commit65a151094edeb04e8f5f6f1502028e2383e81bb8 (patch)
treee1c79de194d66e4f6c065c54d6e198c0c68ef98c
parent954cd6dc02a65065aecb7150962c0870c5b0e322 (diff)
downloadlwn-65a151094edeb04e8f5f6f1502028e2383e81bb8.tar.gz
lwn-65a151094edeb04e8f5f6f1502028e2383e81bb8.zip
afs: ->writepage() shouldn't call clear_page_dirty_for_io()
The ->writepage() op shouldn't call clear_page_dirty_for_io() as that has already been called by the caller. Fix afs_writepage() by moving the call out of afs_write_back_from_locked_page() to afs_writepages_region() where it is needed. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--fs/afs/write.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/afs/write.c b/fs/afs/write.c
index 134de0667898..e5f150bccfb5 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -231,7 +231,7 @@ flush_conflicting_wb:
if (wb->state == AFS_WBACK_PENDING)
wb->state = AFS_WBACK_CONFLICTING;
spin_unlock(&vnode->writeback_lock);
- if (PageDirty(page)) {
+ if (clear_page_dirty_for_io(page)) {
ret = afs_write_back_from_locked_page(wb, page);
if (ret < 0) {
afs_put_writeback(candidate);
@@ -353,8 +353,6 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb,
_enter(",%lx", primary_page->index);
count = 1;
- if (!clear_page_dirty_for_io(primary_page))
- BUG();
if (test_set_page_writeback(primary_page))
BUG();
@@ -542,6 +540,8 @@ static int afs_writepages_region(struct address_space *mapping,
wb->state = AFS_WBACK_WRITING;
spin_unlock(&wb->vnode->writeback_lock);
+ if (!clear_page_dirty_for_io(page))
+ BUG();
ret = afs_write_back_from_locked_page(wb, page);
unlock_page(page);
put_page(page);