Re:[PATCH] fuse: remove useless IOCB_DIRECT in fuse_direct_read/write_iter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 26, 2024 at 09:12:39PM +0200, Miklos Szeredi wrote:
> On Mon, 26 Aug 2024 at 15:07, yangyun <yangyun50@xxxxxxxxxx> wrote:
> >
> > Commit 23c94e1cdcbf ("fuse: Switch to using async direct IO
> > for FOPEN_DIRECT_IO") gave the async direct IO code path in the
> > fuse_direct_read_iter() and fuse_direct_write_iter(). But since
> > these two functions are only called under FOPEN_DIRECT_IO is set,
> > it seems that we can also use the async direct IO even the flag
> > IOCB_DIRECT is not set to enjoy the async direct IO method. Also
> > move the definition of fuse_io_priv to where it is used in fuse_
> > direct_write_iter.
> 
> I'm interested in the motivation for this patch.
> 
> There's a minor risk of regressions when introducing such a behavior
> change, so there should also be a strong supporting argument, which
> seems to be missing in this case.

Thanks for your reply!

It seems that there is a risk of regressions. But I think adding an argument 
in this case is not so graceful, whatever adding this argument to the 
`struct fuse_file->open_flags` or adding it to the init flags in `struct 
fuse_init_args`.

The reasons are:

1. Commit 23c94e1cdcbf ("fuse: Switch to using async direct IO for FOPEN_DIRECT_IO") 
also changes the behavior from sync to async direct io, but does not import a new 
argument to avoid the risk of regressions.

2. Fuse already has an init flags FUSE_ASYNC_DIO in `fuse_init_args`, which indicates
that the direct io should be submitted asynchrounously. The comment in function 
`fuse_direct_IO()` also indicates the situation:
"
      /*   
         * By default, we want to optimize all I/Os with async request
         * submission to the client filesystem if supported.
         */
"
But the code does not go through the async direct io code path in the case described in current patch.

3. If adding a argument, it would be so many arguments about async and direct io (FUSE_ASYNC_DIO, 
FUSE_ASYNC_READ, FOPEN_DIRECT_IO, etc), which may be redundant and confuse the developers about 
their differences.

What do you think ? 

> 
> Thanks,
> Miklos




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux