lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240827114146.3474592-1-yangyun50@huawei.com>
Date: Tue, 27 Aug 2024 19:41:46 +0800
From: yangyun <yangyun50@...wei.com>
To: <miklos@...redi.hu>
CC: <linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<lixiaokeng@...wei.com>, <yangyun50@...wei.com>
Subject: Re:[PATCH] fuse: remove useless IOCB_DIRECT in fuse_direct_read/write_iter

On Mon, Aug 26, 2024 at 09:12:39PM +0200, Miklos Szeredi wrote:
> On Mon, 26 Aug 2024 at 15:07, yangyun <yangyun50@...wei.com> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ