summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-03-02 22:52:14 +0000
committerrwatson <rwatson@FreeBSD.org>2008-03-02 22:52:14 +0000
commitba77105862d9ce174c62fa671e0daaf18228dde3 (patch)
tree13dae77df2f921b9632f72bdf6fb98214632e7a6 /sys
parent960a8a877c79df08c682d18ee670bf851bdf5594 (diff)
downloadFreeBSD-src-ba77105862d9ce174c62fa671e0daaf18228dde3.zip
FreeBSD-src-ba77105862d9ce174c62fa671e0daaf18228dde3.tar.gz
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
Diffstat (limited to 'sys')
-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