diff options
author | ssouhlal <ssouhlal@FreeBSD.org> | 2005-09-02 15:27:23 +0000 |
---|---|---|
committer | ssouhlal <ssouhlal@FreeBSD.org> | 2005-09-02 15:27:23 +0000 |
commit | f8217f350bcfc82b94c814a04faf8cdd5326d033 (patch) | |
tree | 6d3fd63626ff1d58add99ac395ebda844196e694 /sys/fs/udf | |
parent | 912d183e0b4eff2d1cfeacc98dc5720f1461a947 (diff) | |
download | FreeBSD-src-f8217f350bcfc82b94c814a04faf8cdd5326d033.zip FreeBSD-src-f8217f350bcfc82b94c814a04faf8cdd5326d033.tar.gz |
*_mountfs() (if the filesystem mounts from a device) needs devvp to be
locked, so lock it.
Glanced at by: phk
MFC after: 3 days
Diffstat (limited to 'sys/fs/udf')
-rw-r--r-- | sys/fs/udf/udf_vfsops.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index f0db5b2..7292fc1 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -228,19 +228,18 @@ udf_mount(struct mount *mp, struct thread *td) /* Check that the mount device exists */ if (fspec == NULL) return (EINVAL); - NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fspec, td); + NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspec, td); if ((error = namei(ndp))) return (error); NDFREE(ndp, NDF_ONLY_PNBUF); devvp = ndp->ni_vp; if (vn_isdisk(devvp, &error) == 0) { - vrele(devvp); + vput(devvp); return (error); } /* Check the access rights on the mount device */ - vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); error = VOP_ACCESS(devvp, VREAD, td->td_ucred, td); if (error) error = suser(td); @@ -248,7 +247,6 @@ udf_mount(struct mount *mp, struct thread *td) vput(devvp); return (error); } - VOP_UNLOCK(devvp, 0, td); if ((error = udf_mountfs(devvp, mp, td))) { vrele(devvp); |