linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Schubert <bernd.schubert@fastmail.fm>
To: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>,
	mszeredi@redhat.com
Cc: "Al Viro" <viro@zeniv.linux.org.uk>,
	"Amir Goldstein" <amir73il@gmail.com>,
	"Stéphane Graber" <stgraber@ubuntu.com>,
	"Seth Forshee" <sforshee@kernel.org>,
	"Christian Brauner" <brauner@kernel.org>,
	"Andrei Vagin" <avagin@gmail.com>,
	"Pavel Tikhomirov" <ptikhomirov@virtuozzo.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	criu@openvz.org
Subject: Re: [RFC PATCH 6/9] fuse: take fuse connection generation into account
Date: Fri, 3 Mar 2023 19:45:04 +0100	[thread overview]
Message-ID: <ba148a1a-26da-4fcc-e24c-b1f79d9ba014@fastmail.fm> (raw)
In-Reply-To: <20230220193754.470330-7-aleksandr.mikhalitsyn@canonical.com>


[...]
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index d5b30faff0b9..be9086a1868d 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -110,7 +110,8 @@ static void fuse_file_put(struct fuse_file *ff, bool sync, bool isdir)
>   	if (refcount_dec_and_test(&ff->count)) {
>   		struct fuse_args *args = &ff->release_args->args;
>   
> -		if (isdir ? ff->fm->fc->flags.no_opendir : ff->fm->fc->flags.no_open) {
> +		if (fuse_stale_ff(ff) ||
> +		    (isdir ? ff->fm->fc->flags.no_opendir : ff->fm->fc->flags.no_open)) {
>   			/* Do nothing when client does not implement 'open' */

The comment does not match anymore.

>   			fuse_release_end(ff->fm, args, 0);
>   		} else if (sync) {
> @@ -597,9 +598,10 @@ static int fuse_fsync(struct file *file, loff_t start, loff_t end,
>   {
>   	struct inode *inode = file->f_mapping->host;
>   	struct fuse_conn *fc = get_fuse_conn(inode);
> +	struct fuse_file *ff = file->private_data;
>   	int err;
>   
> -	if (fuse_is_bad(inode))
> +	if (fuse_stale_ff(ff) || fuse_is_bad(inode))
>   		return -EIO;
>   
>   	inode_lock(inode);
> diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
> index 4f4a6f912c7c..0643de31674d 100644
> --- a/fs/fuse/fuse_i.h
> +++ b/fs/fuse/fuse_i.h
> @@ -954,7 +954,8 @@ static inline bool fuse_stale_inode(const struct inode *inode, int generation,
>   				    struct fuse_attr *attr)
>   {
>   	return inode->i_generation != generation ||
> -		inode_wrong_type(inode, attr->mode);
> +		inode_wrong_type(inode, attr->mode) ||
> +		fuse_stale_inode_conn(inode);
>   }
>   
>   static inline void fuse_make_bad(struct inode *inode)
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index c3109e016494..f9dc8971274d 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -124,7 +124,7 @@ static void fuse_evict_inode(struct inode *inode)
>   			fuse_dax_inode_cleanup(inode);
>   		if (fi->nlookup) {
>   			fuse_queue_forget(fc, fi->forget, fi->nodeid,
> -					  fi->nlookup, false);
> +					  fi->nlookup, fuse_stale_inode_conn(inode));
>   			fi->forget = NULL;
>   		}
>   	}

  reply	other threads:[~2023-03-03 18:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 19:37 [RFC PATCH 0/9] fuse: API for Checkpoint/Restore Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 1/9] fuse: move FUSE_DEFAULT_* defines to fuse common header Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 2/9] fuse: add const qualifiers to common fuse helpers Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 3/9] fuse: add fuse connection generation Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 4/9] fuse: handle stale inode connection in fuse_queue_forget Alexander Mikhalitsyn
2023-03-03 18:47   ` Bernd Schubert
2023-02-20 19:37 ` [RFC PATCH 5/9] fuse: move fuse connection flags to the separate structure Alexander Mikhalitsyn
2023-03-03 18:26   ` Bernd Schubert
2023-02-20 19:37 ` [RFC PATCH 6/9] fuse: take fuse connection generation into account Alexander Mikhalitsyn
2023-03-03 18:45   ` Bernd Schubert [this message]
2023-02-20 19:37 ` [RFC PATCH 7/9] fuse: add fuse device ioctl(FUSE_DEV_IOC_REINIT) Alexander Mikhalitsyn
2023-03-03 19:19   ` Bernd Schubert
2023-04-03 14:56     ` Aleksandr Mikhalitsyn
2023-03-03 19:26   ` Bernd Schubert
2023-03-06 14:09     ` Aleksandr Mikhalitsyn
2023-04-03 14:51       ` Aleksandr Mikhalitsyn
2023-04-11 22:18         ` Bernd Schubert
2023-02-20 19:37 ` [RFC PATCH 8/9] namespace: add sb_revalidate_bindmounts helper Alexander Mikhalitsyn
2023-02-20 19:37 ` [RFC PATCH 9/9] fuse: add fuse device ioctl(FUSE_DEV_IOC_BM_REVAL) Alexander Mikhalitsyn
2023-03-03 19:42 ` [RFC PATCH 0/9] fuse: API for Checkpoint/Restore Bernd Schubert
2023-03-06 14:06   ` Aleksandr Mikhalitsyn
2023-03-06 16:14 ` Miklos Szeredi
2023-03-06 16:44   ` Aleksandr Mikhalitsyn
2023-03-06 19:18     ` Miklos Szeredi
2023-03-06 21:05       ` Bernd Schubert
2023-03-06 22:16         ` Aleksandr Mikhalitsyn

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=ba148a1a-26da-4fcc-e24c-b1f79d9ba014@fastmail.fm \
    --to=bernd.schubert@fastmail.fm \
    --cc=aleksandr.mikhalitsyn@canonical.com \
    --cc=amir73il@gmail.com \
    --cc=avagin@gmail.com \
    --cc=brauner@kernel.org \
    --cc=criu@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=sforshee@kernel.org \
    --cc=stgraber@ubuntu.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).