Skip to content

FUSE passthrough fixes

Amir Goldstein linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fuse: fix wrong ff->iomode state changes from parallel dio writefs/fuse/file.c fs/fuse/fuse_i.h fs/fuse/inode.c +1 more+56 -296 replies
2/3fuse: fix parallel dio write on file open in passthrough modefs/fuse/iomode.c+2 -20 replies
3/3fuse: prepare for long lived reference on backing filefs/fuse/file.c fs/fuse/fuse_i.h fs/fuse/inode.c +1 more+22 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] FUSE passthrough fixes

Miklos,

While going over the code to prepare for getattr() passthrough I experienced a WTF moment that resulted in the two fix patches.

Patch 3/3 is included for reference and to give Sweet Tea a starting point for getattr() passthrough.

What puzzled me is that some ff->iomode state bugs were so blunt that I needed to figure out how I did not see any WARN_ON in my tests of rc1. There are different reasons for different types of bugs.

1. For concurrent dio writes without any passthrough open, fuse_file_cached_io_start() was supposed to hit WARN_ON(ff->iomode == IOM_UNCACHED) if there is already a dio write in-flight.

My conclusion is that the set of fstests that run on passthrough_hp, on my small test VM do not excercise concurrent dio writes.

2. For dio write, where the file was opened passthrough, every write was going to hit WARN_ON(ff->iomode == IOM_UNCACHED) and also fuse_file_cached_io_end() was going to set ff->iomode == IOM_NONE and leak the fuse_backing object.

However, the bug fixed by patch 2/3 made sure that parallel dio write would always fallback to exclusive dio if file was open with a backing file.

Testing:

I ran fstests with passthrough_hp with options:
1) FOPEN_PASSTHROUGH
2) FOPEN_DIRECT_IO | FOPEN_PARALLEL_DIRECT_WRITES
3) FOPEN_PASSTHROUGH | FOPEN_DIRECT_IO | FOPEN_PARALLEL_DIRECT_WRITES

Did not observe any regressions (not any improvments) from rc1.

Ran some multi threads aiodio tests with just patch 2/3 and the assertions in fuse_evict_inode() from patch 3/3.

First two configs did not hit any assertion.
The passthrough+direct_io+parallel_direct_writes config always hits the assertion in fuse_file_cached_io_start() and always hits the leaked fuse_backing assertion in fuse_evict_inode().

Bernd do you have different tests to cover concurrent dio writes in your setup? Any ideas on how to improve the fstests test coverage?

Thanks,
Amir.

Amir Goldstein (3):
fuse: fix wrong ff->iomode state changes from parallel dio write
fuse: fix parallel dio write on file open in passthrough mode
fuse: prepare for long lived reference on backing file

 fs/fuse/file.c   | 18 +++++++-----
 fs/fuse/fuse_i.h | 10 +++++--
 fs/fuse/inode.c  |  7 +++++
 fs/fuse/iomode.c | 73 +++++++++++++++++++++++++++++++++---------------
 4 files changed, 76 insertions(+), 32 deletions(-)
Signature · 1 line
2.34.1