From: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
libc-alpha-9JcytcrH/bA+uJoB2kUjGw@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
andreas.gruenbacher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 0/3] Extended file stat system call [ver #2]
Date: Thu, 14 Nov 2013 14:19:54 -0500 [thread overview]
Message-ID: <20131114191953.GB21152@fieldses.org> (raw)
In-Reply-To: <20131112184127.2880.24025.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
On Tue, Nov 12, 2013 at 06:41:27PM +0000, David Howells wrote:
>
> Implement a new system call to provide an extended and further extensible stat
> function.
>
> =======
> CHANGES
> =======
>
> (*) Added an optional auxiliary data buffer pointer argument to sys_statxat()
> and moved some of the stuff into it.
>
> (*) Discarded "has an ACL info flag" for now.
>
> (*) AFS doesn't need to set time granularity itself as the default is 1s
> anyway.
>
>
> ===========
> DESCRIPTION
> ===========
>
> The second of the associated patches is the main patch that provides this new
> system call:
>
> long ret = statxat(int dfd,
> const char *filename,
> unsigned atflag,
> unsigned mask,
> struct statx *buffer,
> struct statx_auxinfo *auxinfo);
>
> which is more fully documented in the main patch's description.
>
> This new stat function provides a number of useful features, in summary:
>
> (1) More information: creation time, data version number, flags/attributes.
> A subset of these is available through a number of filesystems (such as
> CIFS, NFS, AFS, Ext4 and BTRFS).
>
> (2) Lightweight stat: Ask for just those details of interest, and allow a
> netfs (such as NFS) to approximate anything not of interest, possibly
> without going to the server.
>
> (3) Heavyweight stat: Force a netfs to go to the server, even if it thinks its
> cached attributes are up to date.
I'm not following the lightweight/heavyweight thing: so this is encoded
in the mask? So it's just a 1-bit value per attribute? Because it
seems like there are potentially 3 different behaviors:
- definitely get this from the server now even if you normally
wouldn't.
- definitely don't go to the server even if you know your cache
is stale.
- do whatever you'd normally do (check how old your cache is or
whatever).
I guess this is what you're asking in "considerations" below.
--b.
> (4) Allow the filesystem to indicate what it can/cannot provide: A filesystem
> can now say it doesn't support a standard stat feature if that isn't
> available.
>
> (5) Make the fields a consistent size on all arches, and make them large.
>
> (6) Can be extended by using more request flags and appending further data
> after the end of the standard return data.
>
> Note that no lstat() equivalent is required as that can be implemented through
> statxat() with atflag == 0. There is also no fstat() equivalent as that can be
> implemented through statxat() with filename == NULL and the relevant fd passed
> as dfd.
>
>
> =======
> PATCHES
> =======
>
> Patch 1 introduces IOC flags for Windows Hidden, Archive and System attributes.
>
> Patch 2 defines the statxat() system call.
>
> Patch 3 implements extended stat facilities for AFS. Other fs patches to go
> through their respective trees once the core is in.
>
>
> ==============
> CONSIDERATIONS
> ==============
>
> Should the default for a network fs be to do an unconditional (heavyweight)
> stat with a flag to suppress going to the server to update the locally held
> attributes and flushing pending writebacks?
>
> Is it useful to pass the volume ID out? Or should statfs() be used for this?
>
> Is there anything else I can usefully add at the moment?
>
>
> ==========
> TO BE DONE
> ==========
>
> Autofs, ntfs, btrfs, ...
>
> I should perhaps use u8/u32/u64 rather than uint8/32/64_t.
>
> Handle remote filesystems being offline and indicate this with
> STATX_INFO_OFFLINE.
>
> Should a "light stat" be explicitly requested by its own AT_ flag?
>
>
> =======
> TESTING
> =======
>
> There's a test program attached to the description for the main patch. It can
> be run as follows:
> [root@andromeda tmp]# ./xstat -R /mnt/foo
>
> xstat(/mnt/foo) = 0
> 0000: 000081a40000ffef 0000000000000001 0000020000000000 0000100000080000
> 0020: 0000000000000000 0000000600000008 000000004f88499a 0000000136fd9208
> 0040: 000000004f88499a 0000000136fd9208 000000004f8849b9 0000000106daf187
> 0060: 000000004f8849b9 0000000106daf187 000000000000000c 000000000000000f
> 0080: 0000000000000008 00000000484ebbef 0000000000000025 5949ebd4711efd82
> 00a0: d3250b5c15d5e380 0000000000000000 0000000000000000 0000000000000000
> 00c0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> 00e0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> results=ffef
> Size: 15 Blocks: 8 IO Block: 4096 regular file
> Device: 08:06 Inode: 12 Links: 1
> Access: (0644/-rw-r--r--) Uid: 0
> Gid: 0
> Access: 2012-04-13 16:43:22.922587656+0100
> Modify: 2012-04-13 16:43:53.115011975+0100
> Change: 2012-04-13 16:43:53.115011975+0100
> Create: 2012-04-13 16:43:22.922587656+0100
> Inode version: 484ebbefh
> Data version: 25h
> Inode flags: 00080000 (-------- ----e--- -------- --------)
> Information: 00000200 (-------- -------- ------a- --------)
> Volume ID: 82fd1e71d4eb4959-80e3d5155c0b25d3
>
> David
> ---
> David Howells (3):
> statxat: Provide IOC flags for Windows fs attributes
> statxat: Add a system call to make extended file stats available
> statxat: AFS: Return enhanced basic attributes
>
>
> arch/x86/ia32/sys_ia32.c | 2
> arch/x86/syscalls/syscall_32.tbl | 1
> arch/x86/syscalls/syscall_64.tbl | 1
> fs/afs/inode.c | 46 ++++-
> fs/ceph/inode.c | 2
> fs/cifs/inode.c | 5 -
> fs/compat.c | 2
> fs/nfsd/nfsxdr.c | 2
> fs/stat.c | 348 ++++++++++++++++++++++++++++++++++++--
> include/linux/fs.h | 3
> include/linux/stat.h | 16 ++
> include/linux/syscalls.h | 6 +
> include/uapi/linux/fcntl.h | 1
> include/uapi/linux/fs.h | 7 +
> include/uapi/linux/stat.h | 164 ++++++++++++++++++
> 15 files changed, 567 insertions(+), 39 deletions(-)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2013-11-14 19:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-12 18:41 [PATCH 0/3] Extended file stat system call [ver #2] David Howells
2013-11-12 18:41 ` [PATCH 1/3] statxat: Provide IOC flags for Windows fs attributes " David Howells
2013-11-14 22:11 ` Dave Chinner
2013-11-12 18:41 ` [PATCH 3/3] statxat: AFS: Return enhanced basic " David Howells
2013-11-13 4:15 ` [PATCH 0/3] Extended file stat system call " Carlos O'Donell
[not found] ` <20131112184127.2880.24025.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2013-11-12 18:41 ` [PATCH 2/3] statxat: Add a system call to make extended file stats available " David Howells
[not found] ` <20131112184142.2880.21338.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2013-11-12 22:43 ` Andreas Dilger
2013-11-14 19:19 ` J. Bruce Fields [this message]
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=20131114191953.GB21152@fieldses.org \
--to=bfields-uc3wqj2krung9huczpvpmw@public.gmane.org \
--cc=andreas.gruenbacher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=libc-alpha-9JcytcrH/bA+uJoB2kUjGw@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org \
--cc=viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.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).