summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2015-03-23 11:02:30 -0400
committerJ. Bruce Fields <bfields@redhat.com>2015-03-25 21:06:16 -0400
commit340f0ba1c6c8412aa35fd6476044836b84361ea6 (patch)
tree2c3fca4f7a7995a36545fdbaa311eeadfcdedaf9 /fs/nfsd/nfs4state.c
parentc5952338bfc234e54deda45b7228f610a545e28a (diff)
downloadblackbird-op-linux-340f0ba1c6c8412aa35fd6476044836b84361ea6.tar.gz
blackbird-op-linux-340f0ba1c6c8412aa35fd6476044836b84361ea6.zip
nfsd: return correct lockowner when there is a race on hash insert
alloc_init_lock_stateowner can return an already freed entry if there is a race to put openowners in the hashtable. Noticed by inspection after Jeff Layton fixed the same bug for open owners. Depending on client behavior, this one may be trickier to trigger in practice. Fixes: c58c6610ec24 "nfsd: Protect adding/removing lock owners using client_lock" Cc: <stable@vger.kernel.org> Cc: Trond Myklebust <trond.myklebust@primarydata.com> Acked-by: Jeff Layton <jeff.layton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index cf29d1a698b3..8ba1d888f1e6 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5062,7 +5062,7 @@ alloc_init_lock_stateowner(unsigned int strhashval, struct nfs4_client *clp,
} else
nfs4_free_lockowner(&lo->lo_owner);
spin_unlock(&clp->cl_lock);
- return lo;
+ return ret;
}
static void
OpenPOWER on IntegriCloud