Skip to content

fuse direct write consolidation and parallel IO

Bernd Schubert linux-btrfs linux-fsdevel oe-kbuild-all 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest10 patches 1 replyIn review
  2. v30 of 5 patches 0 repliesSuperseded
  3. v25 patches 14 repliesSuperseded

Changes in v4 from the cover letter

checkpatch cleanup

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10fuse: direct IO can use the write-through code pathfs/fuse/file.c+1 -10 replies
2/10fuse: Create helper function if DIO write needs exclusive lockfs/fuse/file.c+34 -150 replies
3/10fuse: prepare support for shared lock for DIO writesfs/fuse/file.c+31 -20 replies
4/10fs: Add and export file_needs_remove_privsfs/inode.c include/linux/fs.h+9 -00 replies
5/10fuse: enable shared lock for O_DIRECT / handle privilege dropfs/fuse/file.c+19 -60 replies
6/10fuse: Rename fuse_direct_iofs/fuse/cuse.c fs/fuse/dax.c fs/fuse/file.c +1 more+14 -150 replies
7/10fuse: Remove fuse_direct_write_iter code path / use IOCB_DIRECTfs/fuse/file.c+8 -501 reply
8/10fuse: Remove page flush/invaliation in fuse_direct_iofs/fuse/file.c+0 -170 replies
9/10fuse: Use the existing inode fuse_cache_write_iterfs/fuse/file.c+1 -10 replies
10/10fuse: No privilege removal when FOPEN_DIRECT_IO is setfs/fuse/file.c+5 -20 replies

Reviews trailers per patch

2 of 10 patches have a Reviewed-by or Acked-by.

PatchMiklos Szeredi
1/10A-b
2/10
3/10
4/10
5/10
6/10
7/10
8/10A-b
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/10] fuse direct write consolidation and parallel IO

This series consolidates DIO writes into a single code path via fuse_cache_write_iter/generic_file_direct_write. Before
it was only used for O_DIRECT and when writeback cache was not enabled. For server/daemon dio enforcement (FOPEN_DIRECT_IO) another code path was used before, but I _think_ that is not needed and just IOCB_DIRECT needs to be set/enforced.
When writeback-cache was enabled another code path was used, with a fallback to write-through - for direct IO that should not be needed either.

So far O_DIRECT through fuse_cache_write_iter also took an exclusive lock, this should not be needed either, at least when server side sets FOPEN_PARALLEL_DIRECT_WRITES.

Regarding xfstests, without FOPEN_DIRECT_IO there are no differences between patched and unpatched. With FOPEN_DIRECT_IO the series fixes generic/647, which was failing unpatched ("pwrite is broken").

v4:
checkpatch cleanup

Addresses review comments
- Fix shared lock in fuse_cache_write_iter, file_remove_privs() needs the exclusive lock. In order to know if the exclusive lock is needed the new exported vfs function file_remove_privs() is introduced.
- Also fixed for the shared lock is the fallback to buffered writes, which also needs the exclusive lock.
- Fixed is the accidental turn around of false/true in fuse_dio_wr_exclusive_lock().
- Added documentation in fuse_write_flags() that the IOCB_DIRECT flag cannot be trusted.

New optional patches
- "fuse: Use the existing inode fuse_cache_write_iter"
- "[RFC] fuse: No privilege removal when FOPEN_DIRECT_IO is set"

v3:
Addresses review comments
- Rename fuse_direct_write_extending_i_size to io_past_eof
- Change to single line conditions in fuse_dio_wr_exclusive_lock (also fixes accidental parenthesis).
- Add another patch to rename fuse_direct_io to fuse_send_dio
- Add detailed information into the commit message of the patch that consolidates IO paths (5/6, previously 4/5) and also update the subject.

v2:
The entire v1 approach to route DIO writes through fuse_direct_write_iter was turned around and fuse_direct_write_iter is removed instead and all DIO writes are now routed through fuse_cache_write_iter

Cc Hao Xu <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Miklos Szeredi <[email protected]>
Cc Dharmendra Singh <[email protected]>

Bernd Schubert (10):
fuse: direct IO can use the write-through code path
fuse: Create helper function if DIO write needs exclusive lock
fuse: prepare support for shared lock for DIO writes
fs: Add and export file_needs_remove_privs
fuse: enable shared lock for O_DIRECT / handle privilege drop
fuse: Rename fuse_direct_io
fuse: Remove fuse_direct_write_iter code path / use IOCB_DIRECT
fuse: Remove page flush/invaliation in fuse_direct_io
fuse: Use the existing inode fuse_cache_write_iter [RFC] fuse: No privilege removal when FOPEN_DIRECT_IO is set

 fs/fuse/cuse.c     |   5 +-
 fs/fuse/dax.c      |   2 +-
 fs/fuse/file.c     | 189 +++++++++++++++++++++++----------------------
 fs/fuse/fuse_i.h   |   8 +-
 fs/inode.c         |   8 ++
 include/linux/fs.h |   1 +
 6 files changed, 113 insertions(+), 100 deletions(-)
Signature · 1 line
2.39.2