summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorTor Egge <tegge@FreeBSD.org>2007-03-13 01:50:27 +0000
committerTor Egge <tegge@FreeBSD.org>2007-03-13 01:50:27 +0000
commit61b9d89ff0a7d4c7bcea7fd083db918e16de41a5 (patch)
tree6dca3f2c99e6dcb6402e1486118e56eb8d5e871b /sys/ufs
parent06e83c7e86824a2bf64e797dca3cf56e60ac3e85 (diff)
Notes
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 788eb2f68d51..7af15dd2b254 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1327,6 +1327,7 @@ ffs_vget(mp, ino, flags, vpp)
struct vnode *vp;
struct cdev *dev;
int error;
+ struct thread *td;
error = vfs_hash_get(mp, ino, flags, curthread, vpp, NULL, NULL);
if (error || *vpp != NULL)
@@ -1391,7 +1392,15 @@ ffs_vget(mp, ino, flags, vpp)
}
#endif
- error = vfs_hash_insert(vp, ino, flags, curthread, vpp, NULL, NULL);
+ td = curthread;
+ lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL, td);
+ error = insmntque(vp, mp);
+ if (error != 0) {
+ uma_zfree(uma_inode, ip);
+ *vpp = NULL;
+ return (error);
+ }
+ error = vfs_hash_insert(vp, ino, flags, td, vpp, NULL, NULL);
if (error || *vpp != NULL)
return (error);