summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsfh.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@poochiereds.net>2015-08-24 12:41:47 -0400
committerJ. Bruce Fields <bfields@redhat.com>2015-08-31 16:32:15 -0400
commite85687393f3ee0a77ccca016f903d1558bb69258 (patch)
tree6683eba3ed1b59e299f085ed56d98d2fc67530f6 /fs/nfsd/nfsfh.h
parent051ac3848a94f21cfdec899cc9c65ce7f9f116fa (diff)
downloadlinux-stable-e85687393f3ee0a77ccca016f903d1558bb69258.tar.gz
linux-stable-e85687393f3ee0a77ccca016f903d1558bb69258.tar.bz2
linux-stable-e85687393f3ee0a77ccca016f903d1558bb69258.zip
nfsd: ensure that the ol stateid hash reference is only put once
When an open or lock stateid is hashed, we take an extra reference to it. When we unhash it, we drop that reference. The code however does not properly account for the case where we have two callers concurrently trying to unhash the stateid. This can lead to list corruption and the hash reference being put more than once. Fix this by having unhash_ol_stateid use list_del_init on the st_perfile list_head, and then testing to see if that list_head is empty before releasing the hash reference. This means that some of the unhashing wrappers now become bool return functions so we can test to see whether the stateid was unhashed before we put the reference. Reported-by: Andrew W Elble <aweits@rit.edu> Tested-by: Andrew W Elble <aweits@rit.edu> Reported-by: Anna Schumaker <Anna.Schumaker@netapp.com> Tested-by: Anna Schumaker <Anna.Schumaker@netapp.com> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com> Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfsfh.h')
0 files changed, 0 insertions, 0 deletions