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


Groups > linux.kernel > #1525120

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

From Andreas Dilger <adilger@dilger.ca>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available
Date 2016-11-18 10:30 +0100
Message-ID <sENEB-5bP-11@gated-at.bofh.it> (permalink)
References <sEHpv-XS-7@gated-at.bofh.it> <sEvol-1nz-5@gated-at.bofh.it> <sEvol-1nz-3@gated-at.bofh.it> <sEzLl-4lB-67@gated-at.bofh.it> <sENbz-4Ni-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[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





Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[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

csiph-web