summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2019-10-31 18:40:33 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-06 13:06:22 +0100
commit74001646d47c900e2f817f684d92e4ce0f96e9eb (patch)
tree5ddc48cf3555c7edf3714b3ac33697612790b987
parentfd9a708c7bde2175357acf87ff3a4416b9807f59 (diff)
downloadlinux-stable-74001646d47c900e2f817f684d92e4ce0f96e9eb.tar.gz
linux-stable-74001646d47c900e2f817f684d92e4ce0f96e9eb.tar.bz2
linux-stable-74001646d47c900e2f817f684d92e4ce0f96e9eb.zip
NFS: Fix an RCU lock leak in nfs4_refresh_delegation_stateid()
commit 79cc55422ce99be5964bde208ba8557174720893 upstream. A typo in nfs4_refresh_delegation_stateid() means we're leaking an RCU lock, and always returning a value of 'false'. As the function description states, we were always supposed to return 'true' if a matching delegation was found. Fixes: 12f275cdd163 ("NFSv4: Retry CLOSE and DELEGRETURN on NFS4ERR_OLD_STATEID.") Cc: stable@vger.kernel.org # v4.15+ Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/nfs/delegation.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 1624618c2bc7..825a8c52165a 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -1154,7 +1154,7 @@ bool nfs4_refresh_delegation_stateid(nfs4_stateid *dst, struct inode *inode)
if (delegation != NULL &&
nfs4_stateid_match_other(dst, &delegation->stateid)) {
dst->seqid = delegation->stateid.seqid;
- return ret;
+ ret = true;
}
rcu_read_unlock();
out: