From ba77105862d9ce174c62fa671e0daaf18228dde3 Mon Sep 17 00:00:00 2001 From: rwatson Date: Sun, 2 Mar 2008 22:52:14 +0000 Subject: 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(+) (limited to 'sys') 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) { -- cgit v1.1