]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: ensure atomicity in nfsd4_free_stateid and nfsd4_validate_stateid
authorJeff Layton <jlayton@primarydata.com>
Wed, 30 Jul 2014 01:34:14 +0000 (21:34 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 31 Jul 2014 18:20:08 +0000 (14:20 -0400)
commitc46cfe3ce5622302101a35d3babdcfd93ef319ca
treec6ab339fa7c5a88a6e935a2b38904b5da2c0da3f
parent72e9dfd620bf4b5c5d9102795587c8e8c08b5c6d
nfsd: ensure atomicity in nfsd4_free_stateid and nfsd4_validate_stateid

Hold the cl_lock over the bulk of these functions. In addition to
ensuring that they aren't freed prematurely, this will also help prevent
a potential race that could be introduced later. Once we remove the
client_mutex, it'll be possible for FREE_STATEID and CLOSE to race and
for both to try to put the "persistent" reference to the stateid.

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