summaryrefslogtreecommitdiff
path: root/fs/nfsd/state.h
diff options
context:
space:
mode:
authorOleg Drokin <green@linuxhacker.ru>2016-06-15 06:28:04 +0300
committerJ. Bruce Fields <bfields@redhat.com>2016-06-16 05:03:31 +0300
commitfeb9dad5209280085d5b0c094fa67e7a8d75c81a (patch)
treef7af4bd1e0c206528e71706bd62064fbea7082ad /fs/nfsd/state.h
parent39a9beab5acb83176e8b9a4f0778749a09341f1f (diff)
downloadlinux-feb9dad5209280085d5b0c094fa67e7a8d75c81a.tar.xz
nfsd: Always lock state exclusively.
It used to be the case that state had an rwlock that was locked for write by downgrades, but for read for upgrades (opens). Well, the problem is if there are two competing opens for the same state, they step on each other toes potentially leading to leaking file descriptors from the state structure, since access mode is a bitmap only set once. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r--fs/nfsd/state.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 986e51e5ceac..64053eadeb81 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -535,7 +535,7 @@ struct nfs4_ol_stateid {
unsigned char st_access_bmap;
unsigned char st_deny_bmap;
struct nfs4_ol_stateid *st_openstp;
- struct rw_semaphore st_rwsem;
+ struct mutex st_mutex;
};
static inline struct nfs4_ol_stateid *openlockstateid(struct nfs4_stid *s)