diff options
| author | Jeff Layton <jlayton@redhat.com> | 2016-08-11 10:37:39 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-20 18:09:21 +0200 |
| commit | 37cbe5b6d12580c6bb189dc3be418b681ce7d5a1 (patch) | |
| tree | bdc2ed3e2b2063c01d42d0f866f51e742fc2fed6 /scripts | |
| parent | 6dfc20babd386b8990c9ad99fa9e3afe875cba1f (diff) | |
nfsd: don't return an unhashed lock stateid after taking mutex
commit dd257933fa4b9fea66a1195f8a15111029810abc upstream.
nfsd4_lock will take the st_mutex before working with the stateid it
gets, but between the time when we drop the cl_lock and take the mutex,
the stateid could become unhashed (a'la FREE_STATEID). If that happens
the lock stateid returned to the client will be forgotten.
Fix this by first moving the st_mutex acquisition into
lookup_or_create_lock_state. Then, have it check to see if the lock
stateid is still hashed after taking the mutex. If it's not, then put
the stateid and try the find/create again.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Tested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
