summaryrefslogtreecommitdiffstats
path: root/sys/fs/fdescfs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-04-04 09:37:57 +0000
committerkib <kib@FreeBSD.org>2008-04-04 09:37:57 +0000
commitdae02901d4b70eed4b1ba8f47235c1316e802c58 (patch)
tree291eb8c5f3c57031a2baf19d82176467a01cd661 /sys/fs/fdescfs
parent15c3f17df08bbfcf604019832f4f92806388ef32 (diff)
downloadFreeBSD-src-dae02901d4b70eed4b1ba8f47235c1316e802c58.zip
FreeBSD-src-dae02901d4b70eed4b1ba8f47235c1316e802c58.tar.gz
The temporary workaround for the call to the vget() without lock type in
the fdesc_allocvp(). The caller of the fdesc_allocvp() expects that the returned vnode is not reclaimed. Do lock the vnode exclusive and drop the lock after. Reported by: pho Reviewed by: jeff
Diffstat (limited to 'sys/fs/fdescfs')
-rw-r--r--sys/fs/fdescfs/fdesc_vnops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
index 44b7310..06b1718 100644
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -116,9 +116,11 @@ fdesc_allocvp(ftype, ix, mp, vpp, td)
loop:
LIST_FOREACH(fd, fc, fd_hash) {
if (fd->fd_ix == ix && fd->fd_vnode->v_mount == mp) {
- if (vget(fd->fd_vnode, 0, td))
+ if (vget(fd->fd_vnode, LK_EXCLUSIVE | LK_CANRECURSE,
+ td))
goto loop;
*vpp = fd->fd_vnode;
+ VOP_UNLOCK(*vpp, 0);
return (error);
}
}
OpenPOWER on IntegriCloud