linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Schubert <bernd.schubert@fastmail.fm>
To: Yuan Yao <yuanyaogoog@chromium.org>
Cc: linux-fsdevel@vger.kernel.org, miklos@szeredi.hu, dsingh@ddn.com,
	hbirthelmer@ddn.com, brauner@kernel.org, viro@zeniv.linux.org.uk,
	bschubert@ddn.com, keiichiw@chromium.org, takayas@chromium.org
Subject: Re: [PATCH 1/1] fuse: Handle no_open/no_opendir in atomic_open
Date: Wed, 29 Nov 2023 23:21:30 +0100	[thread overview]
Message-ID: <c652fc1f-cef6-46a9-a47b-d23fb877c5cf@fastmail.fm> (raw)
In-Reply-To: <20231129064607.382933-2-yuanyaogoog@chromium.org>



On 11/29/23 07:46, Yuan Yao wrote:
> Currently, if the fuse server supporting the no_open/no_opendir feature
> uses atomic_open to open a file, the corresponding no_open/no_opendir
> flag is not set in kernel. This leads to the kernel unnecessarily
> sending extra FUSE_RELEASE request, receiving an empty reply from
> server when closes that file.
> 
> This patch addresses the issue by setting the no_open/no_opendir feature
> bit to true if the kernel receives a valid dentry with an empty file
> handler.
> 
> Signed-off-by: Yuan Yao <yuanyaogoog@chromium.org>
> ---
>   fs/fuse/dir.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
> index 9956fae7f875..edee4f715f39 100644
> --- a/fs/fuse/dir.c
> +++ b/fs/fuse/dir.c
> @@ -8,6 +8,7 @@
>   
>   #include "fuse_i.h"
>   
> +#include <linux/fuse.h>
>   #include <linux/pagemap.h>
>   #include <linux/file.h>
>   #include <linux/fs_context.h>
> @@ -869,6 +870,13 @@ static int _fuse_atomic_open(struct inode *dir, struct dentry *entry,
>   		goto out_err;
>   	}
>   
> +	if (ff->fh == 0) {
> +		if (ff->open_flags & FOPEN_KEEP_CACHE)
> +			fc->no_open = 1;
> +		if (ff->open_flags & FOPEN_CACHE_DIR)
> +			fc->no_opendir = 1;
> +	}
> +
>   	/* prevent racing/parallel lookup on a negative hashed */
>   	if (!(flags & O_CREAT) && !d_in_lookup(entry)) {
>   		d_drop(entry);


Thanks, I first need to fix all the issues Al found (and need to find 
the time for that, hopefully during the next days) and will then add 
this to my series.

(We also need to document for userspace that the atomic_open method 
shall not fill in fi->fh in atomic-open, if it wants the no-open feature).

Thanks,
Bernd

  reply	other threads:[~2023-11-29 22:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 18:30 [PATCH v10 0/8] fuse: full atomic open and atomic-open-revalidate Bernd Schubert
2023-10-23 18:30 ` [PATCH v10 1/8] fuse: rename fuse_create_open Bernd Schubert
2023-10-23 18:30 ` [PATCH v10 2/8] fuse: introduce atomic open Bernd Schubert
2023-10-24 10:12   ` Yuan Yao
2023-10-24 12:36     ` Bernd Schubert
2023-10-26  2:42       ` Yuan Yao
2023-11-29  6:46         ` [PATCH 0/1] Adapt atomic open to fuse no_open/no_open_dir Yuan Yao
2023-11-29  6:46           ` [PATCH 1/1] fuse: Handle no_open/no_opendir in atomic_open Yuan Yao
2023-11-29 22:21             ` Bernd Schubert [this message]
2023-10-28  3:03   ` [PATCH v10 2/8] fuse: introduce atomic open Al Viro
2023-10-30 15:21     ` Bernd Schubert
2024-01-23  8:40   ` [PATCH 0/1] Fix-atomic_open-not-using-negative-d_entry Yuan Yao
2024-01-23  8:40     ` [PATCH 1/1] fuse: Make atomic_open use negative d_entry Yuan Yao
2024-01-27 13:38       ` Bernd Schubert
2024-02-09  7:46         ` Yuan Yao
2024-02-19 11:37           ` Bernd Schubert
2024-03-13 10:25             ` Yuan Yao
2024-03-13 23:00               ` Bernd Schubert
2024-03-14 10:34   ` [PATCH] fuse: Do NULL check instead of IS_ERR in atomic_open Keiichi Watanabe
2024-03-15 13:09     ` Keiichi Watanabe
2024-03-24  4:32     ` Al Viro
2023-10-23 18:30 ` [PATCH v10 3/8] [RFC] Allow atomic_open() on positive dentry (O_CREAT) Bernd Schubert
2023-10-23 18:30 ` [PATCH v10 4/8] [RFC] Allow atomic_open() on positive dentry (w/o O_CREAT) Bernd Schubert
2023-10-24 13:46   ` Bernd Schubert
2023-10-28  4:46   ` Al Viro
2023-10-23 18:30 ` [PATCH v10 5/8] fuse: Revalidate positive entries in fuse_atomic_open Bernd Schubert
2023-10-28  5:18   ` Al Viro
2023-10-28  5:25   ` Al Viro
2023-10-23 18:30 ` [PATCH v10 6/8] fuse: Return D_REVALIDATE_ATOMIC for cached dentries Bernd Schubert
2023-10-23 18:30 ` [PATCH v10 7/8] fuse: Avoid code duplication in atomic open Bernd Schubert
2023-10-23 18:30 ` [PATCH v10 8/8] fuse atomic open: No fallback for symlinks, just call finish_no_open Bernd Schubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c652fc1f-cef6-46a9-a47b-d23fb877c5cf@fastmail.fm \
    --to=bernd.schubert@fastmail.fm \
    --cc=brauner@kernel.org \
    --cc=bschubert@ddn.com \
    --cc=dsingh@ddn.com \
    --cc=hbirthelmer@ddn.com \
    --cc=keiichiw@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=takayas@chromium.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yuanyaogoog@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).