From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Linus Torvalds
<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org,
linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 02/18] xstat: Add a pair of system calls to make extended file stats available [ver #6]
Date: Mon, 19 Jul 2010 17:15:32 +0100 [thread overview]
Message-ID: <10783.1279556132@redhat.com> (raw)
In-Reply-To: <AANLkTikuzYqYpGHcubb7QVciZW0dNFjOG82qIwy5M4gO-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Linus Torvalds <torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> wrote:
> - that whole xstat buffer handling is just a mess. I think you
> already fixed the "xstat_parameters" crud and just made it a simple
> unsigned long and a direct argument,
I was thinking more of an unsigned int argument, since it can't have more than
32 flags in it if it is also to work on 32-bit arches.
> but the "buffer+buflen" thing is still disgusting.
>
> Why not just leave a few empty fields at the end, and make the rule
> be: "We don't just add random crap, so don't expect it to grow widely
> in the future".
Because it gets allocated on the kernel stack. It's already 160 bytes, and
expanding it will eat more kernel stack space. Now, I can offset that by: (a)
embedding it in struct kstat so that we allocate less stack space in xstat()
overall, and (b) allocating kstat/xstat structs with kmalloc() rather than on
the stack in all the stat syscalls.
> - you use "long long" all over the place. Don't do that. If you want
> a fixed size, say so, and use "u64/s64". That's the _real_ fixed size,
> and "long long" just _happens_ to be the same size on all current
> architectures.
I was following struct stat/stat64 in arch/x86/include/asm/stat.h which do the
same. Also, if this is going to be seen by userspace, isn't it better to use
uint32_t and suchlike?
> - why create that new kind of xstat() that realistically absolutely
> nobody will use outside of some very special cases, and that has no
> real advantages for 99.9% of all people?
The new information is useful for some cases. Samba for example. At least
two of the fields I'm adding are also made available through BSD's stat()
call, and will automatically be used for some things by autoconf magic if they
become available.
I'm still trying to get a handle on what people think will be truly useful. I
can see things *could* be useful, particularly to GUI file managers and ls,
but not everyone is of the same opinion.
Perhaps you or others can offer answers to the following questions as these
might help:
(1) Should I offer information that's effectively free to come by, but could
be got through:
(a) An extra statfs() call - such as whether a file is remote, whether
it's some kernel special file? Or what the volume label is for this
file?
(b) An extra getxattr() call - such as a file's security label.
(c) An extra ioctl() call - such as FS_IOC_GETFLAGS.
(2) Should I offer information that's appropriate to non-UNIX filesystems
such as FAT, NTFS or CIFS. Some of this may map onto other fields, such
as FS_IOC_GETFLAGS.
(3) Should I offer information about which results that I've returned are
actually useful, as opposed to being fabricated on the spot? Such as
UID/GID in FAT or blocks in UBIFS. This may be of use to df or a GUI.
For instance, a GUI, seeing that UID/GID aren't useful, could ask the
filesystem to provide information about what it considers to be valid
ownership information.
> You could make it a "atomic stat+open" by replacing the useless
> "size" return value with a "fd" return value, add a flag saying "we're
> also interested in opening it" (in the same result set flags), and
> instead of that stupid "buflen" input, give the "mode" input that open
> needs.
Which would be used by even fewer people, I suspect. However, it's certainly
an interesting idea. I suspect it doesn't gain much over open()+fstat()
though, given that you'd still have to do most of the work of fstat() after
doing the open() thing anyway.
Also, I'm not sure how much use the atomicity is, given that the file may have
changed state between the gathering of the stat data and userspace getting to
do anything with it.
> > ssize_t ret = fxstat(unsigned fd,
>
> Quite frankly, my gut feel is that once you do "xstat(dfd, filename,
> ...)" then it's damn stupid to do a separate "fxstat()", when you
> might as well say that "xtstat(dfd, NULL, ...)" is the same as
> "fxstat(fd, ...)"
This has been suggested and denounced as stupid already. That said, I agree
with you.
> Now, the difference between adding one or two system calls may not be
> huge, but just from a cleanliness angle, I really don't see the point
> of having another fstat variant when the extended xstat() already very
> naturally supports the thing. And let's face it, using a NULL path
> pointer just makes sense if you don't have a path. You already passed
> it a target file descriptor in the dfd.
Agreed.
David
next prev parent reply other threads:[~2010-07-19 16:15 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-15 2:17 [PATCH 00/18] Extended file stat functions [ver #6] David Howells
2010-07-15 2:17 ` [PATCH 01/18] Mark arguments to certain syscalls as being const " David Howells
2010-07-15 2:17 ` [PATCH 02/18] xstat: Add a pair of system calls to make extended file stats available " David Howells
2010-07-15 20:35 ` Arnd Bergmann
[not found] ` <201007152235.22373.arnd-r2nGTMty4D4@public.gmane.org>
2010-07-15 21:53 ` David Howells
2010-07-16 10:24 ` David Howells
[not found] ` <8527.1279275842-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-07-16 11:02 ` Arnd Bergmann
[not found] ` <201007161302.35775.arnd-r2nGTMty4D4@public.gmane.org>
2010-07-16 12:38 ` David Howells
[not found] ` <10677.1279283886-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-07-16 13:32 ` Arnd Bergmann
2010-07-17 5:51 ` Mark Harris
2010-07-17 9:00 ` Arnd Bergmann
[not found] ` <20100717055130.GA2053-EJgEOVOPJGBzbRFIqnYvSA@public.gmane.org>
2010-07-17 9:49 ` David Howells
[not found] ` <30646.1279230807-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-07-16 10:46 ` Arnd Bergmann
[not found] ` <201007161246.15923.arnd-r2nGTMty4D4@public.gmane.org>
2010-07-16 15:10 ` David Howells
[not found] ` <20100715021712.5544.44845.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2010-07-16 6:22 ` Mark Harris
2010-07-18 8:48 ` Christoph Hellwig
2010-07-22 10:52 ` Jan Engelhardt
[not found] ` <alpine.LSU.2.01.1007221248050.9353-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
2010-07-22 12:25 ` David Howells
2010-07-22 10:35 ` Jan Engelhardt
2010-07-19 14:05 ` David Howells
2010-07-19 15:17 ` Linus Torvalds
[not found] ` <AANLkTikuzYqYpGHcubb7QVciZW0dNFjOG82qIwy5M4gO-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-19 16:15 ` David Howells [this message]
[not found] ` <10783.1279556132-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-07-19 16:51 ` Linus Torvalds
[not found] ` <AANLkTinVns77R7yCCh-lydd0eQufdAF9O2OaWmCL7uSn-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-19 17:26 ` David Howells
[not found] ` <11817.1279560400-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-07-19 17:46 ` Linus Torvalds
[not found] ` <AANLkTikxHJgguNn6EOK6fX53xYSRPmcNjIeGSTigQ9qu-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-20 8:28 ` Andreas Dilger
2010-07-22 12:14 ` David Howells
2010-07-22 12:17 ` Volker Lendecke
[not found] ` <E1Obuiy-00C9jr-Al-dqLtpHMqGvUyWpdLl23E4A@public.gmane.org>
2010-07-22 13:05 ` Jan Engelhardt
2010-07-22 15:14 ` Linus Torvalds
[not found] ` <AANLkTikBCXK6uEwWq4f0LvpdoKCPs3jvyFa4Zw4e2J_7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-22 15:36 ` Volker Lendecke
2010-07-22 15:47 ` Linus Torvalds
[not found] ` <AANLkTimwIq0pBhCeOjOVjB0yeM3JHOvzVoj9M4ui6al9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-22 16:06 ` Greg Freemyer
[not found] ` <AANLkTimsjARdMfnvFRSyy6gakCtVhGRBbyauVTc_Cuwt-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-22 16:07 ` Greg Freemyer
2010-07-22 16:27 ` Jeremy Allison
2010-07-22 16:40 ` Linus Torvalds
[not found] ` <AANLkTimdFCGSKLn7aGMpBMIauHTsHY7hpAAmpo6uTcnD-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-22 16:58 ` Trond Myklebust
[not found] ` <1279817930.3621.14.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-07-22 18:02 ` Jeremy Allison
2010-07-22 18:04 ` Volker Lendecke
[not found] ` <E1Oc08W-00CZuz-Ns-dqLtpHMqGvUyWpdLl23E4A@public.gmane.org>
2010-07-22 18:07 ` Jeremy Allison
2010-07-22 18:59 ` Trond Myklebust
2010-07-30 17:55 ` Phil Pishioneri
2010-07-30 18:11 ` Trond Myklebust
2010-07-30 18:19 ` Phil Pishioneri
[not found] ` <1280513506.12852.22.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-07-31 18:41 ` Andreas Dilger
[not found] ` <09B770A6-48DB-4296-B6C2-BF46D4DC7E57-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org>
2010-07-31 18:48 ` Jan Engelhardt
2010-07-31 19:03 ` Trond Myklebust
2010-07-31 21:20 ` Jan Engelhardt
2010-08-01 13:17 ` Jeff Layton
2010-07-22 18:05 ` Jan Engelhardt
[not found] ` <alpine.LSU.2.01.1007222004430.4215-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
2010-07-22 18:07 ` Jeremy Allison
2010-07-22 19:18 ` John Stoffel
2010-07-22 17:03 ` Jan Engelhardt
2010-07-22 17:16 ` Trond Myklebust
[not found] ` <1279818967.3621.23.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2010-07-22 17:36 ` Jan Engelhardt
[not found] ` <alpine.LSU.2.01.1007221859180.27496-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
2010-07-22 17:24 ` Linus Torvalds
[not found] ` <AANLkTilmVdyVdO4EmVtTYi_cvMmPqNEPEnzUkJdk1XyR-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-22 18:15 ` Jeremy Allison
2010-07-22 18:41 ` Greg Freemyer
2010-07-22 18:21 ` Benny Halevy
2010-07-22 18:45 ` Greg Freemyer
2010-07-22 19:53 ` Benny Halevy
2010-07-28 1:15 ` Neil Brown
2010-07-28 17:28 ` David Howells
2010-07-28 23:04 ` Neil Brown
2010-07-30 18:38 ` J. Bruce Fields
2010-08-01 13:40 ` Jeff Layton
2010-08-02 14:09 ` Greg Freemyer
[not found] ` <AANLkTi=JvwrwpmteFcXW1f5s95+_w_iCT+04Sy7bbTtR-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-02 14:42 ` Jeff Layton
2010-07-29 16:15 ` David Howells
[not found] ` <319.1280420115-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-08-03 1:13 ` Neil Brown
2010-07-22 17:12 ` Jim Rees
2010-07-22 17:32 ` Linus Torvalds
2010-07-23 1:03 ` tridge
[not found] ` <19528.60019.28495.655512-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2010-07-23 1:21 ` Ted Ts'o
[not found] ` <20100723012130.GD16373-AKGzg7BKzIDYtjvyW6yDsg@public.gmane.org>
2010-07-23 2:12 ` tridge-eUNUBHrolfbYtjvyW6yDsg
2010-07-23 9:14 ` Björn Jacke
2010-07-22 16:25 ` Jan Engelhardt
2010-07-22 15:46 ` Jan Engelhardt
[not found] ` <alpine.LSU.2.01.1007221740570.12308-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
2010-07-22 16:06 ` David Howells
2010-07-15 2:17 ` [PATCH 03/18] AFS: Use i_generation not i_version for the vnode uniquifier " David Howells
2010-07-15 2:17 ` [PATCH 04/18] xstat: AFS: Return extended attributes " David Howells
2010-07-15 2:17 ` [PATCH 05/18] xstat: eCryptFS: " David Howells
2010-07-15 2:17 ` [PATCH 06/18] xstat: Ext4: " David Howells
2010-07-15 2:17 ` [PATCH 07/18] xstat: NFS: " David Howells
2010-07-15 2:17 ` [PATCH 08/18] xstat: CIFS: " David Howells
2010-07-15 2:17 ` [PATCH 09/18] xstat: Make special system filesystems return FS_SPECIAL_FL " David Howells
2010-07-18 8:49 ` Christoph Hellwig
2010-07-19 14:09 ` David Howells
[not found] ` <8426.1279548573-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-07-27 13:41 ` David Howells
2010-07-15 2:17 ` [PATCH 10/18] xstat: Make network filesystems return FS_REMOTE_FL " David Howells
2010-07-15 2:17 ` [PATCH 11/18] xstat: Make automounter filesystems return FS_AUTOMOUNT_FL " David Howells
2010-07-15 2:17 ` [PATCH 12/18] xstat: Add a dentry op to handle automounting rather than abusing follow_link() " David Howells
[not found] ` <20100715021723.5544.85730.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2010-07-18 8:50 ` Christoph Hellwig
[not found] ` <20100718085048.GC27794-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2010-07-19 14:10 ` David Howells
2010-07-15 2:17 ` [PATCH 13/18] xstat: AFS: Use d_automount() " David Howells
2010-07-15 2:17 ` [PATCH 14/18] xstat: NFS: " David Howells
2010-07-15 2:17 ` [PATCH 15/18] xstat: CIFS: " David Howells
2010-07-15 2:17 ` [PATCH 16/18] xstat: Remove the automount through follow_link() kludge code from pathwalk " David Howells
2010-07-15 2:17 ` [PATCH 17/18] xstat: Add an AT_NO_AUTOMOUNT flag to suppress terminal automount " David Howells
[not found] ` <20100715021709.5544.64506.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2010-07-15 2:17 ` [PATCH 18/18] xstat: Provide a mechanism to gather extra results for [f]xstat() " David Howells
[not found] ` <20100715021730.5544.68442.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2010-07-18 8:51 ` Christoph Hellwig
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=10783.1279556132@redhat.com \
--to=dhowells-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org \
--cc=torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@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).