From 874f7ae3315d100ea375d03ccf0d54d4444c826e Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 2 Mar 2008 22:52:14 +0000 Subject: [PATCH] Don't auto-start or allow extattrctl for UFS2 file systems, as UFS2 has native extended attributes. This didn't interfere with the operation of UFS2 extended attributes, but the code shouldn't be running for UFS2. MFC after: 2 weeks --- sys/ufs/ufs/ufs_extattr.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index 25adb21ceab..0c50351af10 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -448,8 +448,16 @@ 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) {