From: "J. Bruce Fields" <bfields@fieldses.org>
To: Dave Chinner <david@fromorbit.com>
Cc: David Howells <dhowells@redhat.com>,
adilger@dilger.ca, smfrench@gmail.com, ben@decadent.org.uk,
Trond.Myklebust@netapp.com, roland@hack.frob.com,
linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org,
linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
linux-ext4@vger.kernel.org, linux-api@vger.kernel.org,
libc-alpha@sourceware.org
Subject: Re: Extended file stat: Splitting file- and fs-specific info?
Date: Wed, 9 May 2012 07:14:20 -0400 [thread overview]
Message-ID: <20120509111420.GA23636@fieldses.org> (raw)
In-Reply-To: <20120509042532.GO5091@dastard>
On Wed, May 09, 2012 at 02:25:32PM +1000, Dave Chinner wrote:
> On Tue, May 08, 2012 at 09:09:41PM -0400, J. Bruce Fields wrote:
> > On Wed, May 09, 2012 at 10:24:20AM +1000, Dave Chinner wrote:
> > > On Tue, May 08, 2012 at 09:19:42PM +0100, David Howells wrote:
> > > >
> > > > Should I split the file-specific info and the fs-specific info and make the
> > > > second optional? What I'm thinking of is something like this:
> > > >
> > > > Have a file information structure:
> > > >
> > > > struct statx {
> > > > /* 0x00 */
> > > > uint32_t st_mask; /* What results were written */
> > > > uint32_t st_information; /* Information about the file */
> > > > uint16_t st_mode; /* File mode */
> > > > uint16_t __spare0[3];
> > > > /* 0x10 */
> > > > uint32_t st_uid; /* User ID of owner */
> > > > uint32_t st_gid; /* Group ID of owner */
> > > > uint32_t st_nlink; /* Number of hard links */
> > > > uint32_t st_blksize; /* Optimal size for filesystem I/O */
> > > > /* 0x20 */
> > > > struct statx_dev st_rdev; /* Device ID of special file */
> > > > struct statx_dev st_dev; /* ID of device containing file */
> > > > /* 0x30 */
> > > > int32_t st_atime_ns; /* Last access time (ns part) */
> > > > int32_t st_btime_ns; /* File creation time (ns part) */
> > > > int32_t st_ctime_ns; /* Last attribute change time (ns part) */
> > > > int32_t st_mtime_ns; /* Last data modification time (ns part) */
> > > > /* 0x40 */
> > > > int64_t st_atime; /* Last access time */
> > > > int64_t st_btime; /* File creation time */
> > > > int64_t st_ctime; /* Last attribute change time */
> > > > int64_t st_mtime; /* Last data modification time */
> > > > /* 0x60 */
> > > > uint64_t st_ino; /* Inode number */
> > > > uint64_t st_size; /* File size */
> > > > uint64_t st_blocks; /* Number of 512-byte blocks allocated */
> > > > uint64_t st_gen; /* Inode generation number */
> > >
> > > I don't think we want to expose the inode generation numbers. It is
> > > trivial to construct NFS file handles (usually just fsid, inode
> > > number and generation) with that information and hence bypass
> > > security checks to access files.
> >
> > I'm not convinced there's much value in trying to keep filehandles
> > secret.
>
> Sure, but I can't really see any good reason to expose filesystem
> internal implementation details like this - a generation number is
> usually used to differentiate between inode life cycles which
> userspace has no concept of and is different for every filesystem,
> so it's behaviour and values are not going to be consistent across
> filesystems.
That's OK. The only requirement would be that the (inode number, inode
generation) pair be different for different inodes on the same
filesystem.
> Some filesystems might not even have a generation
> number they can export, and that makes me wonder if there is any
> good reason for exposing it at all.
That's true of a number of these new attributes.
> If you need to discriminate between versions of files with the same
> name, then use name_to_handle_at() and compare filehandles....
Sure.
Since the only use case given for this has been constructing
filehandles, and since we already have an interface for that, I don't
feel particularly strongly about this.
--b.
next prev parent reply other threads:[~2012-05-09 11:14 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-19 14:05 [PATCH 0/6] Extended file stat system call David Howells
2012-04-19 14:06 ` [PATCH 1/6] xstat: Add a pair of system calls to make extended file stats available David Howells
2012-04-19 23:36 ` Andreas Dilger
2012-04-24 21:29 ` J. Bruce Fields
2012-04-24 22:08 ` Steve French
2012-04-25 14:44 ` Andreas Dilger
2012-04-26 13:45 ` David Howells
2012-04-26 14:28 ` J. Bruce Fields
2012-04-26 17:06 ` Steve French
2012-04-26 13:32 ` David Howells
2012-04-27 0:51 ` Dave Chinner
2012-04-27 3:11 ` Andreas Dilger
2012-04-26 13:40 ` David Howells
2012-04-26 14:23 ` J. Bruce Fields
2012-04-19 14:06 ` [PATCH 2/6] xstat: Ext4: Return extended attributes David Howells
2012-04-19 16:03 ` Steve French
2012-04-26 13:47 ` David Howells
2012-04-26 17:00 ` Steve French
2012-04-19 14:06 ` [PATCH 3/6] xstat: AFS: " David Howells
2012-04-19 14:06 ` [PATCH 4/6] xstat: NFS: " David Howells
2012-04-19 14:35 ` Myklebust, Trond
2012-04-26 13:52 ` David Howells
2012-04-19 14:07 ` [PATCH 5/6] xstat: CIFS: " David Howells
2012-04-19 15:19 ` Steve French
2012-04-19 14:07 ` [PATCH 6/6] xstat: eCryptFS: " David Howells
2012-04-19 16:32 ` [PATCH 0/6] Extended file stat system call Roland McGrath
2012-04-19 21:51 ` Paul Eggert
2012-04-19 23:05 ` Roland McGrath
2012-04-26 14:16 ` David Howells
2012-04-26 18:22 ` Roland McGrath
2012-04-26 14:04 ` David Howells
2012-04-26 18:24 ` Roland McGrath
2012-04-19 17:11 ` Steve French
2012-04-19 23:29 ` Andreas Dilger
2012-04-26 13:54 ` David Howells
2012-04-26 18:25 ` Roland McGrath
2012-04-27 23:54 ` Paul Eggert
2012-04-26 21:54 ` David Howells
2012-04-26 22:02 ` Roland McGrath
2012-04-26 22:21 ` Nix
2012-04-26 14:25 ` David Howells
2012-04-26 14:54 ` Steve French
2012-04-26 15:25 ` Myklebust, Trond
2012-04-26 16:56 ` Steve French
2012-04-26 17:00 ` Myklebust, Trond
2012-04-26 17:03 ` Steve French
2012-04-26 17:06 ` Myklebust, Trond
2012-04-26 17:09 ` Steve French
2012-04-26 17:10 ` Steve French
2012-04-26 21:57 ` David Howells
2012-04-26 22:05 ` Roland McGrath
2012-04-27 0:33 ` Myklebust, Trond
2012-04-27 0:30 ` Myklebust, Trond
2012-04-26 15:52 ` David Howells
2012-04-27 0:29 ` Andreas Dilger
2012-04-27 9:19 ` David Howells
2012-04-27 1:06 ` Dave Chinner
2012-04-27 3:22 ` Andreas Dilger
2012-04-28 0:38 ` Dave Chinner
2012-04-28 0:54 ` Steve French
2012-04-27 9:39 ` David Howells
2012-04-27 13:13 ` Dave Chinner
2012-04-27 15:10 ` J. Bruce Fields
2012-04-27 16:32 ` Steve French
2012-04-27 19:31 ` Andreas Dilger
2012-04-28 0:58 ` Dave Chinner
2012-05-10 9:51 ` David Howells
2012-05-08 20:19 ` Extended file stat: Splitting file- and fs-specific info? David Howells
2012-05-08 21:13 ` Myklebust, Trond
2012-05-09 0:24 ` Dave Chinner
2012-05-09 1:09 ` J. Bruce Fields
2012-05-09 4:25 ` Dave Chinner
2012-05-09 11:14 ` J. Bruce Fields [this message]
2012-05-09 1:16 ` Andreas Dilger
2012-05-10 9:23 ` David Howells
2012-05-10 16:05 ` Andreas Dilger
2012-05-10 17:10 ` Roland McGrath
2012-05-11 8:54 ` Andreas Dilger
2012-05-09 9:21 ` David Howells
2012-05-09 11:19 ` Christoph Hellwig
2012-05-09 11:55 ` Bernd Schubert
2012-05-09 12:05 ` Christoph Hellwig
2012-05-09 12:25 ` Bernd Schubert
2012-05-09 13:51 ` Andreas Dilger
2012-05-09 14:12 ` Bernd Schubert
2012-05-10 9:14 ` David Howells
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=20120509111420.GA23636@fieldses.org \
--to=bfields@fieldses.org \
--cc=Trond.Myklebust@netapp.com \
--cc=adilger@dilger.ca \
--cc=ben@decadent.org.uk \
--cc=david@fromorbit.com \
--cc=dhowells@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=roland@hack.frob.com \
--cc=samba-technical@lists.samba.org \
--cc=smfrench@gmail.com \
/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).