Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a7266f29 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Gerrit - the friendly Code Review server
Browse files

fuse: Fix O_DIRECT operations vs cached writeback misorder



The problem is:

1. write cached data to a file
2. read directly from the same file (via another fd)

The 2nd operation may read stale data, i.e. the one that was in a file
before the 1st op. Problem is in how fuse manages writeback.

When direct op occurs the core kernel code calls filemap_write_and_wait
to flush all the cached ops in flight. But fuse acks the writeback right
after the ->writepages callback exits w/o waiting for the real write to
happen. Thus the subsequent direct op proceeds while the real writeback
is still in flight. This is a problem for backends that reorder operation.

Fix this by making the fuse direct IO callback explicitly wait on the
in-flight writeback to finish.

Change-Id: I9749cf91aaba4e2a74646edcb886d7245173d987
Signed-off-by: default avatarMaxim Patlasov <MPatlasov@parallels.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Git-commit:  ea8cd33390fafc1eca06a26e6a9c7bf1d386526f
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git


Signed-off-by: default avatarNikhilesh Reddy <reddyn@codeaurora.org>
parent d3293501
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment