]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: Always lock state exclusively.
authorOleg Drokin <green@linuxhacker.ru>
Wed, 15 Jun 2016 03:28:04 +0000 (23:28 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 16 Jun 2016 02:03:31 +0000 (22:03 -0400)
commit82b4f6c70f8ec716c89673dfd152829f0a299b03
treef7af4bd1e0c206528e71706bd62064fbea7082ad
parent2a936714b9cde2f7c669485066c424ab33a78321
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>
fs/nfsd/nfs4state.c
fs/nfsd/state.h