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
This commit is contained in:
Robert Watson 2008-03-02 22:52:14 +00:00
parent 6944dcc57a
commit 874f7ae331

View File

@ -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) {