linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ronnie sahlberg <ronniesahlberg@gmail.com>
To: Dave Chinner <david@fromorbit.com>
Cc: "Chuck Lever" <chuck.lever@oracle.com>,
	"Pali Rohár" <pali@kernel.org>,
	"Christian Brauner" <brauner@kernel.org>,
	"Jan Kara" <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-kernel@vger.kernel.org, "Steve French" <sfrench@samba.org>,
	"Alexander Viro" <viro@zeniv.linux.org.uk>
Subject: Re: Immutable vs read-only for Windows compatibility
Date: Wed, 15 Jan 2025 09:42:26 +1000	[thread overview]
Message-ID: <CAN05THT8oP4q90wqxSN3vR+EYEPXfe1Ts=rqVYg6mthUXytWbA@mail.gmail.com> (raw)
In-Reply-To: <Z4b0H5hQv0ocD75j@dread.disaster.area>

On Wed, 15 Jan 2025 at 09:32, Dave Chinner <david@fromorbit.com> wrote:
>
> On Tue, Jan 14, 2025 at 04:44:55PM -0500, Chuck Lever wrote:
> > On 1/14/25 4:10 PM, Pali Rohár wrote:
> > > > My thought was to have a consistent API to access these attributes, and
> > > > let the filesystem implementers decide how they want to store them. The
> > > > Linux implementation of ntfs, for example, probably wants to store these
> > > > on disk in a way that is compatible with the Windows implementation of
> > > > NTFS.
> > > >
> > > > A common API would mean that consumers (like NFSD) wouldn't have to know
> > > > those details.
> > > >
> > > >
> > > > --
> > > > Chuck Lever
> > >
> > > So, what about introducing new xattrs for every attribute with this pattern?
> > >
> > > system.attr.readonly
> > > system.attr.hidden
> > > system.attr.system
> > > system.attr.archive
> > > system.attr.temporary
> > > system.attr.offline
> > > system.attr.not_content_indexed
>
> "attr" is a poor choice for an attribute class (yes, naming is
> hard...). It's a windows file attribute class, the name should
> reflect that.
>
> However, my main problem with this approach is that it will be
> pretty nasty in terms of performance regressions. xattr lookup is
> *much* more expensive than reading a field out of the inode itself.
>
> If you want an example of the cost of how a single xattr per file
> can affect the performance of CIFS servers, go run dbench (a CIFS
> workload simulator) with and without xattrs. The difference in
> performance storing a single xattr per file is pretty stark, and it
> only gets worse as we add more xattrs. i.e. xattrs like this will
> have significant performance implications for all file create,
> lookup/stat and unlink operations.
>
> IOWs, If this information is going to be stored as an xattr, it
> needs to be a single xattr with a well defined bit field as it's
> value (i.e. one bit per attribute). The VFS inode can then cache
> that bitfield with minimal addition overhead during the first
> lookup/creation/modification for the purpose of fast, low overhead,
> statx() operation.

For this use case I don't think he means to store them on the cifs
server as xattr
(or case-insensitive extended attributes as cifs does).
They can already be read/written using SMB2 GetInfo/SetInfo commands.

What I think he means is to read these attributes using SMB2 GetInfo
but then present this to the application via a synthetic xattr.
Application reads a magic xattr and then the driver just makes it up based on
other information it has. (cifs does this for other things already afaik)

Correct me if I am wrong Pali, but you mean translate the SMB2 attribute field
into a magic xattr?  But that means it is not storage of the
attributes anymore but rather
the API for applications to read these attributes.

>
> > Yes, all of them could be stored as xattrs for file systems that do
> > not already support these attributes.
> >
> > But I think we don't want to expose them directly to users, however.
> > Some file systems, like NTFS, might want to store these on-disk in a way
> > that is compatible with Windows.
> >
> > So I think we want to create statx APIs for consumers like user space
> > and knfsd, who do not care to know the specifics of how this information
> > is stored by each file system.
> >
> > The xattrs would be for file systems that do not already have a way to
> > represent this information in their on-disk format.
>
> Even the filesystems that store this information natively should
> support the xattr interface - they just return the native
> information in the xattr format, and then every application has a
> common way to change these attributes. (i.e. change the xattr to
> modify the attributes, statx to efficiently sample them.
>
> -Dave.
> --
> Dave Chinner
> david@fromorbit.com
>

  reply	other threads:[~2025-01-14 23:42 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-27 12:15 Immutable vs read-only for Windows compatibility Pali Rohár
2025-01-02 14:37 ` Jan Kara
2025-01-02 15:52   ` Chuck Lever
2025-01-02 18:12     ` Pali Rohár
2025-01-04  8:52     ` Christian Brauner
2025-01-04 11:12       ` Pali Rohár
2025-01-04 15:30       ` Chuck Lever
2025-01-14 21:10         ` Pali Rohár
2025-01-14 21:44           ` Chuck Lever
2025-01-14 21:53             ` Pali Rohár
2025-01-14 23:21               ` Darrick J. Wong
2025-01-14 23:29               ` ronnie sahlberg
2025-01-14 23:55                 ` Pali Rohár
2025-01-14 23:59                   ` Darrick J. Wong
2025-01-15  6:26                     ` Maciej W. Rozycki
2025-01-17 16:53                     ` Amir Goldstein
2025-01-17 17:39                       ` Darrick J. Wong
2025-01-17 17:51                         ` Steve French
2025-01-17 17:57                           ` Pali Rohár
2025-01-17 18:46                         ` Amir Goldstein
2025-01-17 18:59                           ` Pali Rohár
2025-02-02 15:23                             ` Pali Rohár
2025-02-03 21:59                               ` Amir Goldstein
2025-02-03 22:19                                 ` Pali Rohár
2025-02-03 23:02                                   ` Amir Goldstein
2025-02-03 23:34                                     ` Pali Rohár
2025-02-04 11:54                                       ` Amir Goldstein
2025-02-04 21:26                                         ` Pali Rohár
2025-02-05 16:33                                           ` Amir Goldstein
2025-02-05 18:16                                             ` Pali Rohár
2025-02-05 19:04                                               ` Pali Rohár
2025-02-05 21:47                                                 ` Amir Goldstein
2025-02-05 22:01                                               ` Amir Goldstein
2025-02-04 21:32                                 ` Pali Rohár
2025-02-15 23:39                               ` Pali Rohár
2025-01-17 20:21                           ` Darrick J. Wong
2025-01-22  6:05                             ` Christoph Hellwig
2025-01-17 17:52                       ` Pali Rohár
2025-01-14 23:32             ` Dave Chinner
2025-01-14 23:42               ` ronnie sahlberg [this message]
2025-01-15  0:16                 ` Pali Rohár
2025-01-02 17:59   ` Pali Rohár

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='CAN05THT8oP4q90wqxSN3vR+EYEPXfe1Ts=rqVYg6mthUXytWbA@mail.gmail.com' \
    --to=ronniesahlberg@gmail.com \
    --cc=brauner@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=david@fromorbit.com \
    --cc=jack@suse.cz \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pali@kernel.org \
    --cc=sfrench@samba.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).