Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1524445 > unrolled thread

[RFC][PATCH 0/4] Enhanced file stat system call

Started byDavid Howells <dhowells@redhat.com>
First post2016-11-17 15:00 +0100
Last post2016-11-18 10:30 +0100
Articles 4 on this page of 44 — 10 participants

Back to article view | Back to linux.kernel


Contents

  [RFC][PATCH 0/4] Enhanced file stat system call David Howells <dhowells@redhat.com> - 2016-11-17 15:00 +0100
    Re: [RFC][PATCH 0/4] Enhanced file stat system call David Howells <dhowells@redhat.com> - 2016-11-17 18:10 +0100
    Re: [RFC][PATCH 0/4] Enhanced file stat system call David Howells <dhowells@redhat.com> - 2016-11-17 18:10 +0100
      Re: [RFC][PATCH 0/4] Enhanced file stat system call bfields@fieldses.org (J. Bruce Fields) - 2016-11-17 21:10 +0100
        Re: [RFC][PATCH 0/4] Enhanced file stat system call Andreas Dilger <adilger@dilger.ca> - 2016-11-18 03:50 +0100
          Re: [RFC][PATCH 0/4] Enhanced file stat system call NeilBrown <neilb@suse.com> - 2016-11-18 05:40 +0100
      Re: [RFC][PATCH 0/4] Enhanced file stat system call One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-11-18 14:50 +0100
        Re: [RFC][PATCH 0/4] Enhanced file stat system call David Howells <dhowells@redhat.com> - 2016-11-18 14:50 +0100
    Re: [RFC][PATCH 0/4] Enhanced file stat system call Michael Kerrisk <mtk.manpages@gmail.com> - 2016-11-17 18:20 +0100
    [PATCH 3/4] statx: NFS: Return enhanced file attributes David Howells <dhowells@redhat.com> - 2016-11-17 18:20 +0100
    [PATCH 2/4] statx: Ext4: Return enhanced file attributes David Howells <dhowells@redhat.com> - 2016-11-17 18:20 +0100
      Re: [PATCH 2/4] statx: Ext4: Return enhanced file attributes Andreas Dilger <adilger@dilger.ca> - 2016-11-18 04:40 +0100
    [PATCH 4/4] statx: AFS: Return enhanced file attributes David Howells <dhowells@redhat.com> - 2016-11-17 18:20 +0100
      Re: [PATCH 4/4] statx: AFS: Return enhanced file attributes Andreas Dilger <adilger@dilger.ca> - 2016-11-18 09:30 +0100
        Re: [PATCH 4/4] statx: AFS: Return enhanced file attributes David Howells <dhowells@redhat.com> - 2016-11-18 09:50 +0100
    Re: [RFC][PATCH 0/4] Enhanced file stat system call One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-11-17 19:00 +0100
    Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Dave Chinner <david@fromorbit.com> - 2016-11-18 00:50 +0100
      Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available Andreas Dilger <adilger@dilger.ca> - 2016-11-18 04:30 +0100
        Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 11:00 +0100
        Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Dave Chinner <david@fromorbit.com> - 2016-11-18 23:10 +0100
          Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-19 00:00 +0100
            Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Dave Chinner <david@fromorbit.com> - 2016-11-19 23:50 +0100
              Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-22 11:40 +0100
                Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Jeff Layton <jlayton@redhat.com> - 2016-11-22 15:00 +0100
                Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Dave Chinner <david@fromorbit.com> - 2016-11-22 22:00 +0100
            Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-11-21 15:40 +0100
              Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Dave Chinner <david@fromorbit.com> - 2016-11-21 21:50 +0100
      Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 10:40 +0100
        Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Jeff Layton <jlayton@poochiereds.net> - 2016-11-18 18:20 +0100
          Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 19:10 +0100
            Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Jeff Layton <jlayton@redhat.com> - 2016-11-18 20:00 +0100
              Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 20:10 +0100
      Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 10:50 +0100
        Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Dave Chinner <david@fromorbit.com> - 2016-11-18 22:50 +0100
          Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 23:30 +0100
      Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 11:30 +0100
        Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Dave Chinner <david@fromorbit.com> - 2016-11-18 22:30 +0100
          Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 22:50 +0100
            Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Dave Chinner <david@fromorbit.com> - 2016-11-18 23:20 +0100
              Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2016-11-19 11:30 +0100
    Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 09:50 +0100
      Re: [PATCH 1/4] statx: Add a system call to make enhanced file info  available Jeff Layton <jlayton@redhat.com> - 2016-11-18 13:10 +0100
    Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available David Howells <dhowells@redhat.com> - 2016-11-18 10:00 +0100
      Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available Andreas Dilger <adilger@dilger.ca> - 2016-11-18 10:30 +0100

Page 3 of 3 — ← Prev page 1 2 [3]


#1525088 — Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available

FromDavid Howells <dhowells@redhat.com>
Date2016-11-18 09:50 +0100
SubjectRe: [PATCH 1/4] statx: Add a system call to make enhanced file info available
Message-ID<sEN1U-4K5-13@gated-at.bofh.it>
In reply to#1524445
Jeff Layton <jlayton@redhat.com> wrote:

> > If neither AT_STATX_*_SYNC flag is set, the behaviour is the default for
> > stat() on that filesystem.
> > 
> 
> We also need to specify here what happens if both bits are set. Should
> that be -EINVAL?

Makes sense.

This leads to another thought: should fstatat() be allowed to take AT_STATX_*
flags?

David

[toc] | [prev] | [next] | [standalone]


#1525242 — Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available

FromJeff Layton <jlayton@redhat.com>
Date2016-11-18 13:10 +0100
SubjectRe: [PATCH 1/4] statx: Add a system call to make enhanced file info available
Message-ID<sEQ9s-6V1-57@gated-at.bofh.it>
In reply to#1525088
On Fri, 2016-11-18 at 08:48 +0000, David Howells wrote:
> Jeff Layton <jlayton@redhat.com> wrote:
> 
> > 
> > > 
> > > If neither AT_STATX_*_SYNC flag is set, the behaviour is the default for
> > > stat() on that filesystem.
> > > 
> > 
> > We also need to specify here what happens if both bits are set. Should
> > that be -EINVAL?
> 
> Makes sense.
> 
> This leads to another thought: should fstatat() be allowed to take AT_STATX_*
> flags?
> 
> David

In principle, we could. fstatat currently rejects flags that it doesn't
understand with -EINVAL.

That said, I'd vote no -- if you wanted to change an application to
start setting these flags in fstatat calls, then it's just as simple to
convert it over to use statx. I don't see a lot of benefit in adding
that to a legacy syscall.

-- 
Jeff Layton <jlayton@redhat.com>

[toc] | [prev] | [next] | [standalone]


#1525096 — Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available

FromDavid Howells <dhowells@redhat.com>
Date2016-11-18 10:00 +0100
SubjectRe: [PATCH 1/4] statx: Add a system call to make enhanced file info available
Message-ID<sENbz-4Ni-5@gated-at.bofh.it>
In reply to#1524445
Andreas Dilger <adilger@dilger.ca> wrote:

> >> If neither AT_STATX_*_SYNC flag is set, the behaviour is the default for
> >> stat() on that filesystem.
> > 
> > We also need to specify here what happens if both bits are set. Should
> > that be -EINVAL?
> 
> If that is the case, then it doesn't make sense to have two contradictory
> flags.

Yes it does.  There are actually *three* cases, not two.  Maybe, rather than a
pair of flags, I should stake out a 2-bit field with three possible values.

> Pick a default behaviour (i.e. return what is known on the client),

The default behaviour has to be what stat() does now for any particular
filesystem.  statx() is likely to get used to emulate stat() so that stat()
can be made to return safe timestamps.  If we make it so that statx() cannot
do this, it's very likely that we'll see yet another stat() variant syscall
being added.

> and if this is 100% accurate (e.g. local filesystem or filesystem with
> strong coherency)

In a netfs, it was 100% accurate at the point the server started transmitting
its reply.  This may no longer be true - even with something like AFS that has
change notifications.

> then it can optionally set the SYNC flag in the returned
> flags.

So you suggest putting the SYNC flag(s) in the request mask rather than
sharing the AT_* flag space?

> If the application needs 100% accurate size info, then it can set the SYNC
> flag in the request and the filesystem may need to do extra work to fetch
> accurate data from the server.

Note that one of the things that people asked for was a
DONT_GO_TO_THE_SERVER_AT_ALL flag.  I take it this is your suggested default?

David

[toc] | [prev] | [next] | [standalone]


#1525120 — Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available

FromAndreas Dilger <adilger@dilger.ca>
Date2016-11-18 10:30 +0100
SubjectRe: [PATCH 1/4] statx: Add a system call to make enhanced file info available
Message-ID<sENEB-5bP-11@gated-at.bofh.it>
In reply to#1525096

[Multipart message — attachments visible in raw view] — view raw

On Nov 18, 2016, at 1:59 AM, David Howells <dhowells@redhat.com> wrote:
> 
> Andreas Dilger <adilger@dilger.ca> wrote:
> 
>>>> If neither AT_STATX_*_SYNC flag is set, the behaviour is the default for
>>>> stat() on that filesystem.
>>> 
>>> We also need to specify here what happens if both bits are set. Should
>>> that be -EINVAL?
>> 
>> If that is the case, then it doesn't make sense to have two contradictory
>> flags.
> 
> Yes it does.  There are actually *three* cases, not two.  Maybe, rather
> than a pair of flags, I should stake out a 2-bit field with three possible
> values.

That would probably be better in this case.

>> Pick a default behaviour (i.e. return what is known on the client),
> 
> The default behaviour has to be what stat() does now for any particular
> filesystem.  statx() is likely to get used to emulate stat() so that stat()
> can be made to return safe timestamps.  If we make it so that statx() cannot
> do this, it's very likely that we'll see yet another stat() variant syscall
> being added.
> 
>> and if this is 100% accurate (e.g. local filesystem or filesystem with
>> strong coherency)
> 
> In a netfs, it was 100% accurate at the point the server started
> transmitting its reply.  This may no longer be true - even with something
> like AFS that has change notifications.

Sure, that is always true, even when running with a local filesystem.
My distinction here is "whether the client currently has a lock that
ensures its copy of the size is correct" vs. "the client has some size
that was correct at one point but may be totally incorrect now".

>> then it can optionally set the SYNC flag in the returned
>> flags.
> 
> So you suggest putting the SYNC flag(s) in the request mask rather than
> sharing the AT_* flag space?

Sorry, I was conflating flags.

>> If the application needs 100% accurate size info, then it can set the SYNC
>> flag in the request and the filesystem may need to do extra work to fetch
>> accurate data from the server.
> 
> Note that one of the things that people asked for was a
> DONT_GO_TO_THE_SERVER_AT_ALL flag.  I take it this is your suggested default?

Isn't that what NFS does today?

In any case, I'm not trying to rewrite NFS semantics here.  The main fix
would be to have the three-valued two-bit flag so that there aren't two
flags that mean opposite things.  That would also allow expansion to have
a fourth state in the future, if there was a need.

Cheers, Andreas





[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | linux.kernel


csiph-web