aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2013-10-01 10:44:53 -0400
committerMiklos Szeredi <mszeredi@suse.cz>2013-10-01 10:44:53 -0400
commitff17be0864777fe0dfb0a477868a8cb95c1ff90e (patch)
treee45109ae17eee26119d3b4d51f5282067aef09b0 /fs/fuse
parent8b284dc47291daf72fe300e1138a2e7ed56f38ab (diff)
fuse: writepage: skip already in flight
If ->writepage() tries to write back a page whose copy is still in flight, then just skip by calling redirty_page_for_writepage(). This is OK, since now ->writepage() should never be called for data integrity sync. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index f8ff019cc6ec..135360e2b9e5 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1591,6 +1591,18 @@ static int fuse_writepage(struct page *page, struct writeback_control *wbc)
1591{ 1591{
1592 int err; 1592 int err;
1593 1593
1594 if (fuse_page_is_writeback(page->mapping->host, page->index)) {
1595 /*
1596 * ->writepages() should be called for sync() and friends. We
1597 * should only get here on direct reclaim and then we are
1598 * allowed to skip a page which is already in flight
1599 */
1600 WARN_ON(wbc->sync_mode == WB_SYNC_ALL);
1601
1602 redirty_page_for_writepage(wbc, page);
1603 return 0;
1604 }
1605
1594 err = fuse_writepage_locked(page); 1606 err = fuse_writepage_locked(page);
1595 unlock_page(page); 1607 unlock_page(page);
1596 1608