Add a check to determine whether extended attributes have been

initialized on the file system before trying to grab the lock of the
per-mount extattr structure, as this lock is unitialized in that case.
This is needed because ufs_extattr_vnode_inactive is called from
ufs_inactive, which is also used by EA-unaware file systems such as
ext2fs.

Reviewed by:	rwatson
This commit is contained in:
tmm 2001-05-25 18:24:52 +00:00
parent 61a33a7085
commit 76ca05f26f

View File

@ -1250,6 +1250,14 @@ ufs_extattr_vnode_inactive(struct vnode *vp, struct proc *p)
struct mount *mp = vp->v_mount;
struct ufsmount *ump = VFSTOUFS(mp);
/*
* In that case, we cannot lock. We should not have any active vnodes
* on the fs if this is not yet initialized but is going to be, so
* this can go unlocked.
*/
if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_INITIALIZED))
return;
ufs_extattr_uepm_lock(ump, p);
if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_STARTED)) {