All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
	Hongbo Li <lihongbo22@huawei.com>,
	jack@suse.cz, viro@zeniv.linux.org.uk, gnoack@google.com,
	mic@digikod.net, linux-fsdevel@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [RFC PATCH] fs: obtain the inode generation number from vfs directly
Date: Tue, 27 Aug 2024 23:44:38 -0400	[thread overview]
Message-ID: <20240828034438.GB9627@mit.edu> (raw)
In-Reply-To: <20240827171148.GN6043@frogsfrogsfrogs>

On Tue, Aug 27, 2024 at 10:11:48AM -0700, Darrick J. Wong wrote:
> 
> But in seriousness, the usual four filesystems return i_generation.
> That is changed every time an inumber gets reused so that anyone with an
> old file handle cannot accidentally open the wrong file.  In theory one
> could use GETVERSION to construct file handles (if you do, UHLHAND!)
> instead of using name_to_handle_at, which is why it's dangerous to
> implement GETVERSION for everyone without checking if i_generation makes
> sense.

I believe the primary use case for {FS,EXT4}_IOC_GETVERSION was for
userspace NFS servers to construt file handles.

For file systems that don't store persistent i_generation numbers, I
think it would be absolutely wrong that FS_IOC_GETVERSION to return
zero, or some nonsense random number.  The right thing to do would be
to have it return an ENOTTY error if somene tries to call
FS_IOC_GETVERSION on a vfat file system.  Otherwise this could lead to
potential user data loss/corruption for users of userspace nfs servers.

	       	    		    	      	 - Ted

  parent reply	other threads:[~2024-08-28  3:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27  1:41 [RFC PATCH] fs: obtain the inode generation number from vfs directly Hongbo Li
2024-08-27  2:13 ` Darrick J. Wong
2024-08-27  2:32   ` Hongbo Li
2024-08-27  5:37     ` Darrick J. Wong
2024-08-27  9:22       ` Christian Brauner
2024-08-27 17:11         ` Darrick J. Wong
2024-08-28  2:16           ` Hongbo Li
2024-08-28  3:44           ` Theodore Ts'o [this message]
2024-08-28  5:38           ` Dave Chinner
2024-08-28 15:55             ` Jan Kara
2024-08-29  1:46               ` Darrick J. Wong
2024-08-29 13:34               ` Dave Chinner
2024-08-27  2:53 ` Matthew Wilcox
2024-08-27  3:07   ` Hongbo Li
2024-08-28  4:27 ` Dave Chinner
2024-08-28 16:36 ` Tavian Barnes

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=20240828034438.GB9627@mit.edu \
    --to=tytso@mit.edu \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=gnoack@google.com \
    --cc=jack@suse.cz \
    --cc=lihongbo22@huawei.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mic@digikod.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.