Re: [PATCH v2 01/18] vfs: add miscattr ops

From: David Sterba
Date: Tue Mar 23 2021 - 07:26:20 EST


On Mon, Mar 22, 2021 at 03:33:38PM -0700, Darrick J. Wong wrote:
> On Mon, Mar 22, 2021 at 03:48:59PM +0100, Miklos Szeredi wrote:
> > --- a/Documentation/filesystems/vfs.rst
> > +++ b/Documentation/filesystems/vfs.rst
> > @@ -441,6 +441,9 @@ As of kernel 2.6.22, the following members are defined:
> > unsigned open_flag, umode_t create_mode);
> > int (*tmpfile) (struct user_namespace *, struct inode *, struct dentry *, umode_t);
> > int (*set_acl)(struct user_namespace *, struct inode *, struct posix_acl *, int);
> > + int (*miscattr_set)(struct user_namespace *mnt_userns,
> > + struct dentry *dentry, struct miscattr *ma);
> > + int (*miscattr_get)(struct dentry *dentry, struct miscattr *ma);
> > };
> >
> > Again, all methods are called without any locks being held, unless
> > @@ -588,6 +591,18 @@ otherwise noted.
> > atomically creating, opening and unlinking a file in given
> > directory.
> >
> > +``miscattr_get``
>
> I wish this wasn't named "misc" because miscellaneous is vague.

It also adds yet another way to name all the attributes (the "N + 1st
standard" problem). So I'd rather reuse a term that's already known and
understood by users. And this is 'file attributes', eg. as noted in
chattr manual page "change file attributes on a Linux file system".
For clarity avoid any 'x' in the name so we easily distinguish that from
the extended attributes aka xattrs.

We can perhaps live with miscattrs in code as anybody who has ever
touched the flags/attrs interfaces knows what it is referring to.

> fileattr_get, perhaps?

That sounds about right to me.