Honor xattr=sa dataset property

ZFS incorrectly uses directory-based extended attributes even when
xattr=sa is specified as a dataset property or mount option. Support to
honor temporary mount options including "xattr" was added in commit
0282c4137e. There are two issues with the
mount option handling:

* Libzfs has historically included "xattr" in its list of default mount
  options. This overrides the dataset property, so the dataset is always
  configured to use directory-based xattrs even when the xattr dataset
  property is set to off or sa. Address this by removing "xattr" from
  the set of default mount options in libzfs.

* There was no way to enable system attribute-based extended attributes
  using temporary mount options. Add the mount options "saxattr" and
  "dirxattr" which enable the xattr behavior their names suggest.  This
  approach has the advantages of mirroring the valid xattr dataset
  property values and following existing conventions for mount option
  names.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3787
This commit is contained in:
Ned Bass
2015-09-16 02:49:09 -07:00
committed by Brian Behlendorf
parent 66aad10ce8
commit 3af56fd95f
5 changed files with 28 additions and 8 deletions
+11 -3
View File
@@ -83,7 +83,7 @@ under that mountpoint.
This flag sets the SELinux context for the filesytem being mounted.
.TP
.BI "\-o defcontext"
This flag sets the SELinux context for unlabled files.
This flag sets the SELinux context for unlabeled files.
.TP
.BI "\-o rootcontext"
This flag sets the SELinux context for the root inode of the filesystem.
@@ -97,8 +97,16 @@ has an entry in the /etc/fstab file.
This private flag disables extended attributes.
.TP
.BI "\-o xattr
This private flag enables extended attributes and, if appropriate,
adds a ZFS context to the selinux system policy.
This private flag enables directory-based extended attributes and, if
appropriate, adds a ZFS context to the selinux system policy.
.TP
.BI "\-o saxattr
This private flag enables system attributed-based extended attributes and, if
appropriate, adds a ZFS context to the selinux system policy.
.TP
.BI "\-o dirxattr
Equivalent to
.BR xattr .
.TP
.BI "\-o zfsutil"
This private flag indicates that