diff options
author | jhb <jhb@FreeBSD.org> | 2008-09-24 18:51:33 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-09-24 18:51:33 +0000 |
commit | 1161006cb695195ef1ddc08bd587d10755925084 (patch) | |
tree | ee684698e82de9b4671dd17a420741a7518401dd /sys/nfsclient | |
parent | 8d01b3e526211bb7a97d75c934a16413164f2b81 (diff) | |
download | FreeBSD-src-1161006cb695195ef1ddc08bd587d10755925084.zip FreeBSD-src-1161006cb695195ef1ddc08bd587d10755925084.tar.gz |
Part 1 of making shared lookups more resilient with respect to forced
unmounts. When we upgrade a vnode lock from shared to exclusive during
a name cache lookup, fail the lookup with EBADF if the vnode is invalidated
while we are waiting for the exclusive lock.
Also, for correctness (though I'm not sure it can occur in practice),
downgrade an exclusively locked vnode if it should be share locked.
Tested by: pho
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 04b3b34..bbf6810 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -888,7 +888,10 @@ nfs_lookup(struct vop_lookup_args *ap) *vpp = NULLVP; return (error); } - if ((error = cache_lookup(dvp, vpp, cnp)) && error != ENOENT) { + error = cache_lookup(dvp, vpp, cnp); + if (error > 0 && error != ENOENT) + return (error); + if (error == -1) { struct vattr vattr; newvp = *vpp; |