All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: "Theodore Y. Ts'o" <tytso@mit.edu>
Cc: 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: Mon, 30 Nov 2020 21:37:29 -0600	[thread overview]
Message-ID: <f259c5ee-7465-890a-3749-44eb8be0f8cf@sandeen.net> (raw)
In-Reply-To: <20201201032051.GK5364@mit.edu>

On 11/30/20 9:20 PM, Theodore Y. Ts'o wrote:
> On Mon, Nov 30, 2020 at 05:29:47PM -0600, Eric Sandeen wrote:
>> On 11/25/20 3:50 PM, David Howells wrote:
>>> Darrick J. Wong <darrick.wong@oracle.com> wrote:
>>>
>>>> mask=1 bit=0: "attribute not set on this file"
>>>> mask=1 bit=1: "attribute is set on this file"
>>>> mask=0 bit=0: "attribute doesn't fit into the design of this fs"
>>>
>>> Or is "not supported by the filesystem driver in this kernel version".
>>
>> For a concrete example, let's talk about the DAX statx attribute.
>>
>> If the kernel is configured w/o DAX support, should the DAX attr be in the mask?
>> If the block device has no DAX support, should the DAX attr be in the mask?
>> If the filesystem is mounted with dax=never, should the DAX attr be in the mask?
>>
>> About to send a patch for xfs which answers "no" to all of those, but I'm still
>> not quite sure if that's what's expected.  I'll be sure to cc: dhowells, Ira, and
>> others who may care...
> 
> So you're basically proposing that the mask is indicating whether or
> not the attribute is supported by a particular on-disk file system
> image and/or how it is currently configured/mounted --- and not
> whether an attribute is supported by a particular file system
> *implementation*.

Well, not trying to propose anything new, just trying to understand
the intent of the mask to get it set correctly for the dax attribute.

> For example, for ext4, if the extents feature is not enabled (for
> example, when the ext4 file system code is used mount a file system
> whose feature bitmask is consistent with a historic ext2 file system)
> the extents flag should be cleared from the attribute mask?
> 
> This adds a fair amount of complexity to the file system since there
> are a number of flags that might have similar issues --- for example,
> FS_CASEFOLD_FL, and I could imagine for some file systems, where
> different revisions might or might not support reflink FS_NOCOW_FL,
> etc.

I've been told that I'm over-complicating this, yes.

> 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.

-Eric

  reply	other threads:[~2020-12-01  3:38 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 [this message]
2020-12-01  3:50         ` Eric Sandeen
2020-12-01 15:39         ` Theodore Y. Ts'o
2020-12-01 16:25           ` Miklos Szeredi

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=f259c5ee-7465-890a-3749-44eb8be0f8cf@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=darrick.wong@oracle.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 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.