All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@poochiereds.net>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Christoph Hellwig <hch@infradead.org>,
	David Howells <dhowells@redhat.com>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	Eric Biggers <ebiggers3@gmail.com>,
	"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	xfs <linux-xfs@vger.kernel.org>
Subject: Re: statx manpage
Date: Tue, 28 Mar 2017 16:22:34 -0400	[thread overview]
Message-ID: <1490732554.24656.7.camel@poochiereds.net> (raw)
In-Reply-To: <5E78AA22-2C44-4A94-9CEA-A954D836FC6C@dilger.ca>

On Tue, 2017-03-28 at 13:39 -0600, Andreas Dilger wrote:
> On Mar 27, 2017, at 1:04 PM, Jeff Layton <jlayton@poochiereds.net> wrote:
> > 
> > On Mon, 2017-03-27 at 09:46 -0700, Christoph Hellwig wrote:
> > > On Mon, Mar 27, 2017 at 05:25:26PM +0100, David Howells wrote:
> > > > That means a filesystem can't simply return non-basic data unconditionally if
> > > > possible.  I prefer letting it do so if it doesn't incur any extra I/O
> > > > overheads.
> > > 
> > > This seems like it will lead to userspace expecting certain fields to
> > > just be there, and a lot harder to properly verify for tests.  Which btw
> > > we all need for these odd behaviors.  If we can't get them any time soon
> > > (e.g. before -rc6) I think we'll simply have to revert statx instead of
> > > leaving this untested mess in the tree.
> > 
> > I don't think so.
> > 
> > I think we just have to clearly document that that will not be the
> > case. If they really expect the field to be there, then they need to
> > set the bit in the "want" mask -- it's really as simple as that.
> 
> It would be my preference to only return attributes which are explicitly
> requested (Lustre won't return fields for which the bit is not set), but
> there was a request for this behaviour in NFS I recall.
> 
> That said, there are also flags for "lazy" attributes for NFS. I wonder if
> it is enough to pass AT_STATX_DONT_SYNC and request STATX_SIZE | STATX_CTIME,
> or whatever NFS is worried about, and return the client-local version of the
> attributes?
> 
> I guess the real question is what an application is going to do with fields
> that it didn't actually request, and has no way to know if they are valid or
> contain garbage?
> 

You certainly do have a way to know if they're valid. You can check the
stx_mask.

Basically, if you request something, you're guaranteed to get it, or an
error. If you don't request it, you might get it but you had better
check the stx_mask before assuming that you did.

TBQH though, I don't _really_ expect userland to use this that often.

The main reason I'm arguing for this is for simplicity of the in-kernel 
implementations. Having to check each bit in the mask before filling
out its field is cumbersome. It's much simpler to fill out the kstat
struct with what you have and set the stx_mask unconditionally.

It's also not 100% clear to me how the unrequested fields would be set
if we don't allow this. zeroing them out seems like the obvious thing
to do, but that doesn't really provide any guarantee that someone won't
try to interpret it as valid.
-- 
Jeff Layton <jlayton@poochiereds.net>

  reply	other threads:[~2017-03-28 20:22 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07  0:06 [PATCH] xfs: report crtime and attribute flags to statx Darrick J. Wong
2017-03-07  5:01 ` Christoph Hellwig
2017-03-07 17:23   ` Darrick J. Wong
2017-03-07 17:22 ` statx manpage David Howells
2017-03-07 18:02   ` Darrick J. Wong
2017-03-07 18:39   ` David Howells
2017-03-07 18:44     ` Darrick J. Wong
2017-03-07 18:55     ` David Howells
2017-03-07 21:44   ` Andreas Dilger
2017-03-07 22:55   ` Eric Biggers
2017-03-08  3:45   ` Eryu Guan
2017-03-08  9:24   ` David Howells
2017-03-08 15:26     ` Jeff Layton
2017-03-20 16:01       ` Matthew Wilcox
2017-03-22 10:55         ` Jeff Layton
2017-03-08  9:41   ` David Howells
2017-03-10  5:01     ` Eric Biggers
2017-03-09  6:46   ` David Howells
2017-03-09  6:59     ` Eryu Guan
2017-03-09  6:59     ` Darrick J. Wong
2017-03-09 14:01       ` Christoph Hellwig
2017-03-09  7:45     ` David Howells
2017-03-24 20:53   ` Eric Biggers
2017-03-27  0:46     ` Andreas Dilger
2017-03-27 15:40       ` Darrick J. Wong
2017-03-27 16:25       ` David Howells
2017-03-27 16:46         ` Christoph Hellwig
2017-03-27 19:04           ` Jeff Layton
2017-03-28 19:39             ` Andreas Dilger
2017-03-28 20:22               ` Jeff Layton [this message]
2017-03-31 15:49             ` Christoph Hellwig
2017-03-27 18:57         ` David Howells
2017-03-28  0:13         ` [PATCH] Add initial batch of statx() LTP tests David Howells
2017-03-28  6:28           ` Christoph Hellwig
2017-03-28  8:23           ` David Howells
2017-03-27  9:55   ` statx manpage David Howells
2017-03-31 15:56   ` Christoph Hellwig
2017-03-31 16:43   ` David Howells
2017-03-31 16:43     ` David Howells

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=1490732554.24656.7.camel@poochiereds.net \
    --to=jlayton@poochiereds.net \
    --cc=adilger@dilger.ca \
    --cc=darrick.wong@oracle.com \
    --cc=dhowells@redhat.com \
    --cc=ebiggers3@gmail.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.