diff options
author | Ned Bass <[email protected]> | 2015-09-16 02:49:09 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-09-19 14:04:14 -0700 |
commit | 3af56fd95fbe8b417d7ed7c9c25ef59d6f1ee161 (patch) | |
tree | f3900dad139a246b7aa961bbd30735e23299a153 /include/sys | |
parent | 66aad10ce88f2a599365322a79f20d02f3c64393 (diff) |
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
0282c4137e7409e6d85289f4955adf07fac834f5. 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 <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #3787
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/mntent.h | 2 | ||||
-rw-r--r-- | include/sys/zfs_vfsops.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/sys/mntent.h b/include/sys/mntent.h index e6ce11776..7284f05b1 100644 --- a/include/sys/mntent.h +++ b/include/sys/mntent.h @@ -88,6 +88,8 @@ #define MNTOPT_LOUD "loud" /* verbose mount */ #define MNTOPT_BIND "bind" /* remount part of a tree */ #define MNTOPT_RBIND "rbind" /* include subtrees */ +#define MNTOPT_DIRXATTR "dirxattr" /* enable directory xattrs */ +#define MNTOPT_SAXATTR "saxattr" /* enable system-attribute xattrs */ #define MNTOPT_XATTR "xattr" /* enable extended attributes */ #define MNTOPT_NOXATTR "noxattr" /* disable extended attributes */ #define MNTOPT_COMMENT "comment" /* comment */ diff --git a/include/sys/zfs_vfsops.h b/include/sys/zfs_vfsops.h index 3d2b249c9..28407c6f7 100644 --- a/include/sys/zfs_vfsops.h +++ b/include/sys/zfs_vfsops.h @@ -44,6 +44,7 @@ struct znode; typedef struct zfs_mntopts { char *z_osname; /* Objset name */ char *z_mntpoint; /* Primary mount point */ + uint64_t z_xattr; boolean_t z_readonly; boolean_t z_do_readonly; boolean_t z_setuid; @@ -52,7 +53,6 @@ typedef struct zfs_mntopts { boolean_t z_do_exec; boolean_t z_devices; boolean_t z_do_devices; - boolean_t z_xattr; boolean_t z_do_xattr; boolean_t z_atime; boolean_t z_do_atime; |