]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: return correct lockowner when there is a race on hash insert
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 23 Mar 2015 15:02:30 +0000 (11:02 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 26 Mar 2015 01:06:16 +0000 (21:06 -0400)
commit3b28a409e178eb1ca6eb0d339a14f14c09228199
tree2c3fca4f7a7995a36545fdbaa311eeadfcdedaf9
parentc232337c8090eadc6936894d2932a505c49d76f6
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: 90502ab7d488 "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>
fs/nfsd/nfs4state.c