Skip to content

Commit

Permalink
fuse: writepage: skip already in flight
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miklos Szeredi committed Oct 1, 2013
1 parent 8b284dc commit ff17be0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,18 @@ static int fuse_writepage(struct page *page, struct writeback_control *wbc)
{
int err;

if (fuse_page_is_writeback(page->mapping->host, page->index)) {
/*
* ->writepages() should be called for sync() and friends. We
* should only get here on direct reclaim and then we are
* allowed to skip a page which is already in flight
*/
WARN_ON(wbc->sync_mode == WB_SYNC_ALL);

redirty_page_for_writepage(wbc, page);
return 0;
}

err = fuse_writepage_locked(page);
unlock_page(page);

Expand Down

0 comments on commit ff17be0

Please sign in to comment.