Skip to content

Commit

Permalink
vfs: Fix the posix_acl_xattr_list return value
Browse files Browse the repository at this point in the history
When a filesystem that contains POSIX ACLs is mounted without ACL support
(-o noacl), the appropriate behavior is not to list any existing POSIX ACL
xattrs.  The return value for list xattr handlers in this case is 0, not an
error code: several filesystems that use the POSIX ACL xattr handlers do
not expect the list operation to fail.

Symlinks cannot have ACLs, so posix_acl_xattr_list will never be called for
symlinks in the first place.

Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Andreas Gruenbacher authored and Al Viro committed Nov 14, 2015
1 parent c361016 commit dae5f57
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/posix_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,7 @@ posix_acl_xattr_list(struct dentry *dentry, char *list, size_t list_size,
size_t size;

if (!IS_POSIXACL(d_backing_inode(dentry)))
return -EOPNOTSUPP;
if (d_is_symlink(dentry))
return -EOPNOTSUPP;
return 0;

if (type == ACL_TYPE_ACCESS)
xname = POSIX_ACL_XATTR_ACCESS;
Expand Down

0 comments on commit dae5f57

Please sign in to comment.