Skip to content

Commit 41e296f

Browse files
Damenlyakpm00
authored andcommitted
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/[email protected] Signed-off-by: Su Yue <[email protected]> Acked-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Gang He <[email protected]> Cc: Jun Piao <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 46bd944 commit 41e296f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/ocfs2/file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,6 +2763,7 @@ const struct inode_operations ocfs2_file_iops = {
27632763
const struct inode_operations ocfs2_special_file_iops = {
27642764
.setattr = ocfs2_setattr,
27652765
.getattr = ocfs2_getattr,
2766+
.listxattr = ocfs2_listxattr,
27662767
.permission = ocfs2_permission,
27672768
.get_inode_acl = ocfs2_iop_get_acl,
27682769
.set_acl = ocfs2_iop_set_acl,

0 commit comments

Comments
 (0)