From: Jeff Layton <jlayton@kernel.org>
To: Ondrej Valousek <ondrej.valousek.xm@renesas.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>
Cc: "trondmy@hammerspace.com" <trondmy@hammerspace.com>,
"eggert@cs.ucla.edu" <eggert@cs.ucla.edu>,
"bruno@clisp.org" <bruno@clisp.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs: don't call posix_acl_listxattr in generic_listxattr
Date: Tue, 05 Sep 2023 06:50:49 -0400 [thread overview]
Message-ID: <72b43294c85fb7dee01d976da606c5b792c5b430.camel@kernel.org> (raw)
In-Reply-To: <TYCPR01MB11847DEDE49FD02AD9F771971D9E9A@TYCPR01MB11847.jpnprd01.prod.outlook.com>
On Mon, 2023-09-04 at 20:36 +0000, Ondrej Valousek wrote:
> Hi Jeff,
>
> I can confirm that with rawhide kernel 6.5 the error is gone, i.e.
>
> Listxattr() shows only "system.nfs4_acl" attribute on NFSv4 filesystem,
>
> Problem is, that (on the same kernel) getxattr(name,XATTR_NAME_POSIX_ACL_ACCESS, 0,0)
> Sets errno to ENODATA where "name" is file on NFSv4.
>
> This is different behavior to the previous versions, i.e. on RHEL8 getxattr() sets errno to ENOTSUP in the same scenario - which is what I'd expect more.
>
> Is the change of the getxattr() behavior expected or not?
>
> Thanks,
> Ondrej
>
I'd say not. I've been working through xfstests failures on NFS and
didn't realize that this was a regression, and posted this fstests patch
recently:
https://lore.kernel.org/fstests/20230830-fixes-v4-1-88d7b8572aa3@kernel.org/
It would be nice if getxattr were also fixed here.
Cheers,
Jeff
> -----Original Message-----
> From: Jeff Layton <jlayton@kernel.org>
> Sent: Dienstag, 16. Mai 2023 14:47
> To: Alexander Viro <viro@zeniv.linux.org.uk>; Christian Brauner <brauner@kernel.org>
> Cc: trondmy@hammerspace.com; eggert@cs.ucla.edu; bruno@clisp.org; Ondrej Valousek <ondrej.valousek.xm@renesas.com>; linux-fsdevel@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] fs: don't call posix_acl_listxattr in generic_listxattr
>
> Commit f2620f166e2a caused the kernel to start emitting POSIX ACL xattrs for NFSv4 inodes, which it doesn't support. The only other user of generic_listxattr is HFS (classic) and it doesn't support POSIX ACLs either.
>
> Fixes: f2620f166e2a xattr: simplify listxattr helpers
> Reported-by: Ondrej Valousek <ondrej.valousek.xm@renesas.com>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> fs/xattr.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/fs/xattr.c b/fs/xattr.c
> index fcf67d80d7f9..e7bbb7f57557 100644
> --- a/fs/xattr.c
> +++ b/fs/xattr.c
> @@ -985,9 +985,16 @@ int xattr_list_one(char **buffer, ssize_t *remaining_size, const char *name)
> return 0;
> }
>
> -/*
> +/**
> + * generic_listxattr - run through a dentry's xattr list() operations
> + * @dentry: dentry to list the xattrs
> + * @buffer: result buffer
> + * @buffer_size: size of @buffer
> + *
> * Combine the results of the list() operation from every xattr_handler in the
> - * list.
> + * xattr_handler stack.
> + *
> + * Note that this will not include the entries for POSIX ACLs.
> */
> ssize_t
> generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) @@ -996,10 +1003,6 @@ generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
> ssize_t remaining_size = buffer_size;
> int err = 0;
>
> - err = posix_acl_listxattr(d_inode(dentry), &buffer, &remaining_size);
> - if (err)
> - return err;
> -
> for_each_xattr_handler(handlers, handler) {
> if (!handler->name || (handler->list && !handler->list(dentry)))
> continue;
> --
> 2.40.1
>
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2023-09-05 15:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 12:46 [PATCH] fs: don't call posix_acl_listxattr in generic_listxattr Jeff Layton
2023-05-16 14:17 ` Christian Brauner
[not found] ` <TYXPR01MB18549D3A5B0BE777D7F6B284D9799@TYXPR01MB1854.jpnprd01.prod.outlook.com>
2023-05-16 21:22 ` A pass-through support for NFSv4 style ACL Jeff Layton
2023-05-17 7:42 ` Christian Brauner
2023-05-17 7:45 ` Christoph Hellwig
2023-05-17 7:50 ` Christian Brauner
2023-05-17 9:29 ` Ondrej Valousek
2023-05-17 9:58 ` Jeff Layton
2023-05-17 12:39 ` Theodore Ts'o
2023-05-19 10:56 ` Christian Brauner
2023-05-19 11:38 ` Ondrej Valousek
2023-05-19 12:02 ` Christian Brauner
2023-09-04 20:36 ` [PATCH] fs: don't call posix_acl_listxattr in generic_listxattr Ondrej Valousek
2023-09-05 10:50 ` Jeff Layton [this message]
2023-09-05 11:36 ` Ondrej Valousek
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=72b43294c85fb7dee01d976da606c5b792c5b430.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=brauner@kernel.org \
--cc=bruno@clisp.org \
--cc=eggert@cs.ucla.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ondrej.valousek.xm@renesas.com \
--cc=trondmy@hammerspace.com \
--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).