summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorssouhlal <ssouhlal@FreeBSD.org>2005-09-02 13:52:55 +0000
committerssouhlal <ssouhlal@FreeBSD.org>2005-09-02 13:52:55 +0000
commit2f2c6e36696102642cd5fb1e5c4aa72de7bfdf8d (patch)
tree7166ea4d681fd76cbac8f3024df9b42b1b3de25b /sys/ufs
parentdd616181ff96ecf338883e602dca0bb95115d466 (diff)
downloadFreeBSD-src-2f2c6e36696102642cd5fb1e5c4aa72de7bfdf8d.zip
FreeBSD-src-2f2c6e36696102642cd5fb1e5c4aa72de7bfdf8d.tar.gz
ffs_mountfs() needs devvp to be locked, so lock it.
Glanced at by: phk Tested by: pjd MFC after: 3 days
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 19bbb81..111e7a7 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -306,13 +306,13 @@ ffs_mount(struct mount *mp, struct thread *td)
* Not an update, or updating the name: look up the name
* and verify that it refers to a sensible disk device.
*/
- NDINIT(&ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fspec, td);
+ NDINIT(&ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspec, td);
if ((error = namei(&ndp)) != 0)
return (error);
NDFREE(&ndp, NDF_ONLY_PNBUF);
devvp = ndp.ni_vp;
if (!vn_isdisk(devvp, &error)) {
- vrele(devvp);
+ vput(devvp);
return (error);
}
@@ -324,12 +324,10 @@ ffs_mount(struct mount *mp, struct thread *td)
accessmode = VREAD;
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;
- vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
if ((error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td))!= 0){
vput(devvp);
return (error);
}
- VOP_UNLOCK(devvp, 0, td);
}
if (mp->mnt_flag & MNT_UPDATE) {
@@ -342,7 +340,7 @@ ffs_mount(struct mount *mp, struct thread *td)
if (devvp->v_rdev != ump->um_devvp->v_rdev)
error = EINVAL; /* needs translation */
- vrele(devvp);
+ vput(devvp);
if (error)
return (error);
} else {
OpenPOWER on IntegriCloud