Skip to content

Commit

Permalink
Allow xattrs on symlinks
Browse files Browse the repository at this point in the history
The Solaris version of ZFS does not allow xattrs to be set on
symlinks due to the way they implemented the attropen() system
call.  Linux however implements xattrs through the lgetxattr()
and lsetxattr() system calls which do not have this limitation.

The only reason this hasn't always worked under ZFS on Linux
is that the xattr handlers were not registered for symlink type
inodes.  This was done simply to be consistent with the Solaris
behavior.

Upon futher reflection I believe this should be allowed under
Linux.  The only ill effect would be that the xattrs on symlinks
will not be visible when the pool is imported on a Solaris
system.  This also has the benefit that it allows for SELinux
style security xattr labeling which expects to be able to set
xattrs on all inode types.

Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#272
  • Loading branch information
behlendorf committed Nov 29, 2011
1 parent 82a3718 commit f31b3eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions module/zfs/zpl_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ const struct inode_operations zpl_symlink_inode_operations = {
.put_link = zpl_put_link,
.setattr = zpl_setattr,
.getattr = zpl_getattr,
.setxattr = generic_setxattr,
.getxattr = generic_getxattr,
.removexattr = generic_removexattr,
.listxattr = zpl_xattr_list,
};

const struct inode_operations zpl_special_inode_operations = {
Expand Down

0 comments on commit f31b3eb

Please sign in to comment.