Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available
From: David Howells
Date: Fri Nov 18 2016 - 03:59:35 EST
Andreas Dilger <adilger@xxxxxxxxx> 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