linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: "Theodore Y. Ts'o" <tytso@mit.edu>
Cc: Eric Sandeen <sandeen@sandeen.net>,
	David Howells <dhowells@redhat.com>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	linux-fsdevel@vger.kernel.org
Subject: Re: Clarification of statx->attributes_mask meaning?
Date: Tue, 1 Dec 2020 17:25:32 +0100	[thread overview]
Message-ID: <CAJfpegttnxUQP4sPDMCAxmy+Cq=1Vb618iyJJT-df64XgyUBbA@mail.gmail.com> (raw)
In-Reply-To: <20201201153927.GL5364@mit.edu>

On Tue, Dec 1, 2020 at 4:42 PM Theodore Y. Ts'o <tytso@mit.edu> wrote:
>
> On Mon, Nov 30, 2020 at 09:37:29PM -0600, Eric Sandeen wrote:
> > > We should be really clear how applications are supposed to use the
> > > attributes_mask.  Does it mean that they will always be able to set a
> > > flag which is set in the attribute mask?  That can't be right, since
> > > there will be a number of flags that may have some more complex checks
> > > (you must be root, or the file must be zero length, etc.)  I'm a bit
> > > unclear about what are the useful ways in which an attribute_mask can
> > > be used by a userspace application --- and under what circumstances
> > > might an application be depending on the semantics of attribute_mask,
> > > so we don't accidentally give them an opportunity to complain and
> > > whine, thus opening ourselves to another O_PONIES controversy.
> >
> > Hah, indeed.
> >
> > Sorry if I've over-complicated this, I'm honestly just confused now.
>
> Yeah, I'm honestly confused too how applications can use the
> attributes mask, too.

If the meaning is "the flags value is valid" then the use case would be:

 - look in mask if set, if yes, then can use the corresponding flag

 - if mask is not set, then ignore flag, and try to find out the value
of the property some other (possibly more expensive) way.

For STATX_ATTR_DAX it makes sense, since the value can be determined
in alternative ways on old kernels, so application can fall back if
DAX is not in the mask.

As noted upthread any other use would be ambiguous.

Thanks,
Miklos

      reply	other threads:[~2020-12-01 16:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 19:19 Clarification of statx->attributes_mask meaning? Eric Sandeen
2020-11-25 21:25 ` Darrick J. Wong
2020-11-25 21:42   ` Eric Sandeen
2020-11-25 21:50 ` David Howells
2020-11-30 23:29   ` Eric Sandeen
2020-12-01  3:20     ` Theodore Y. Ts'o
2020-12-01  3:37       ` Eric Sandeen
2020-12-01  3:50         ` Eric Sandeen
2020-12-01 15:39         ` Theodore Y. Ts'o
2020-12-01 16:25           ` Miklos Szeredi [this message]

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='CAJfpegttnxUQP4sPDMCAxmy+Cq=1Vb618iyJJT-df64XgyUBbA@mail.gmail.com' \
    --to=miklos@szeredi.hu \
    --cc=darrick.wong@oracle.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    --cc=tytso@mit.edu \
    /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).