]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: close potential race in nfsd4_free_stateid
authorJeff Layton <jlayton@primarydata.com>
Wed, 30 Jul 2014 01:34:40 +0000 (21:34 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 31 Jul 2014 18:20:29 +0000 (14:20 -0400)
commitc89e6b9304039d55a9008b303cf8985c241ad643
tree8fe86bd3204e6476928e171530c777a32d6e58ba
parent74beb48efc93e5cee3bc3fe172282dbfd318d447
nfsd: close potential race in nfsd4_free_stateid

Once we remove the client_mutex, it'll be possible for the sc_type of a
lock stateid to change after it's found and checked, but before we can
go to destroy it. If that happens, we can end up putting the persistent
reference to the stateid more than once, and unhash it more than once.

Fix this by unhashing the lock stateid prior to dropping the cl_lock but
after finding it.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c