summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/ufs/ufs/ufs_extattr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c
index 25adb21..0c50351 100644
--- a/sys/ufs/ufs/ufs_extattr.c
+++ b/sys/ufs/ufs/ufs_extattr.c
@@ -448,9 +448,17 @@ int
ufs_extattr_autostart(struct mount *mp, struct thread *td)
{
struct vnode *rvp, *attr_dvp, *attr_system_dvp, *attr_user_dvp;
+ struct ufsmount *ump = VFSTOUFS(mp);
int error;
/*
+ * UFS_EXTATTR applies only to UFS1, as UFS2 uses native extended
+ * attributes, so don't autostart.
+ */
+ if (ump->um_fstype != UFS1)
+ return (0);
+
+ /*
* Does UFS_EXTATTR_FSROOTSUBDIR exist off the filesystem root?
* If so, automatically start EA's.
*/
@@ -706,6 +714,16 @@ ufs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp,
return (error);
}
+ /*
+ * We only allow extattrctl(2) on UFS1 file systems, as UFS2 uses
+ * native extended attributes.
+ */
+ if (ump->um_fstype != UFS1) {
+ if (filename_vp != NULL)
+ VOP_UNLOCK(filename_vp, 0);
+ return (EOPNOTSUPP);
+ }
+
switch(cmd) {
case UFS_EXTATTR_CMD_START:
if (filename_vp != NULL) {
OpenPOWER on IntegriCloud