aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2021-10-26 02:09:14 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2021-11-09 23:24:01 +0000
commit1a27b987f29806c6b600a61deceb65d30c6049f5 (patch)
treefe433287d87a47df0a62f8104170471ce7550438
parente644c87aa25cffb67729abf929638cc7894e66e4 (diff)
nfscl: Add a missing delegation lock release
There was a case in nfscl_doiods() where the function would return without releasing the delegation shared lock, if it was aquired by the call to nfscl_getstateid(). This patch adds that release. I have never observed a failure due to this missing release, so I do not know if it ever happens in practice. However, since the pNFS client is not yet heavily used, it might be the case. Found by code inspection during a recent NFSv4 IETF working group testing event. (cherry picked from commit 23024f004a4c5659bfcb0b08fac2211ae925ee58)
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index 3d26a1dfda88..50f26a5d70c3 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -5672,6 +5672,8 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit,
if (layp == NULL || rflp == NULL) {
if (recalled != 0) {
NFSFREECRED(newcred);
+ if (lckp != NULL)
+ nfscl_lockderef(lckp);
nfscl_relref(nmp);
return (EIO);
}