diff options
author | dillon <dillon@FreeBSD.org> | 2001-12-27 19:40:34 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-12-27 19:40:34 +0000 |
commit | 2cc743e1244dcc0cd35617ee3ec87f2740bb7cb8 (patch) | |
tree | 0384cbe2d79f6cec7d3fd1b89b4efab5a7af9ae2 /sys/nfsclient/nfs_node.c | |
parent | 82f548fd196d80b812a968821012bff7642ca42d (diff) | |
download | FreeBSD-src-2cc743e1244dcc0cd35617ee3ec87f2740bb7cb8.zip FreeBSD-src-2cc743e1244dcc0cd35617ee3ec87f2740bb7cb8.tar.gz |
nfs_nget() does no locking whatsoever when looking up a vnode. If the
vget() sleeps we have to retry the operation to avoid racing against
a deletion.
MFC maybe: submitted to re's
Diffstat (limited to 'sys/nfsclient/nfs_node.c')
-rw-r--r-- | sys/nfsclient/nfs_node.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c index 21769e2..ed19723 100644 --- a/sys/nfsclient/nfs_node.c +++ b/sys/nfsclient/nfs_node.c @@ -194,7 +194,10 @@ loop: bcmp((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize)) continue; vp = NFSTOV(np); - if (vget(vp, LK_EXCLUSIVE, td)) + /* + * np or vp may become invalid if vget() blocks, so loop + */ + if (vget(vp, LK_EXCLUSIVE|LK_SLEEPFAIL, td)) goto loop; *npp = np; return(0); |