diff options
author | Su Yue <glass.su@suse.com> | 2024-03-12 12:29:08 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-03-14 09:17:29 -0700 |
commit | 41e296f69fb142d8acb2136082521df702422609 (patch) | |
tree | e8fc5feb62c2e97edd049a19ee51e579d639f7d0 /fs/ocfs2 | |
parent | 46bd9449464acd42538409d2f6a866afebf87eea (diff) | |
download | linux-stable-41e296f69fb142d8acb2136082521df702422609.tar.gz linux-stable-41e296f69fb142d8acb2136082521df702422609.tar.bz2 linux-stable-41e296f69fb142d8acb2136082521df702422609.zip |
ocfs2: enable ocfs2_listxattr for special files
For special files in S_IFBLK/S_IFCHR/S_IFIFO type, we already have
ocfs2_setattr and ocfs2_getattr enabled. It's confusing for user space if
it can use setattr/getattr to control one attribute appointed but can not
list attributes using listxattr for above type files:
$ mknod /mnt/b b 0 0
$ setfattr -h -n trusted.name -v 0xbabe /mnt/b
$ getfattr -n trusted.name /mnt/b
getfattr: Removing leading '/' from absolute path names
trusted.name=0sur4=
$ getfattr -m trusted /mnt/b
$
Fix it by enabling ocfs2_listxattr for ocfs2_special_file_iops. After the
commit, fstests/generic/062 will pass.
Link: https://lkml.kernel.org/r/20240312042908.8889-1-l@damenly.org
Signed-off-by: Su Yue <glass.su@suse.com>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/file.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 8b6d15010703..0da8e7bd3261 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -2763,6 +2763,7 @@ const struct inode_operations ocfs2_file_iops = { const struct inode_operations ocfs2_special_file_iops = { .setattr = ocfs2_setattr, .getattr = ocfs2_getattr, + .listxattr = ocfs2_listxattr, .permission = ocfs2_permission, .get_inode_acl = ocfs2_iop_get_acl, .set_acl = ocfs2_iop_set_acl, |