NFSv4: Fix problems with close in the presence of a delegation
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 26 Aug 2014 02:33:12 +0000 (22:33 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 26 Aug 2014 20:17:48 +0000 (16:17 -0400)
commitaee7af356e151494d5014f57b33460b162f181b5
treec551c93d552db5b2992043d1c68404f7dd907df1
parent52addcf9d6669fa439387610bc65c92fa0980cef
NFSv4: Fix problems with close in the presence of a delegation

In the presence of delegations, we can no longer assume that the
state->n_rdwr, state->n_rdonly, state->n_wronly reflect the open
stateid share mode, and so we need to calculate the initial value
for calldata->arg.fmode using the state->flags.

Reported-by: James Drews <drews@engr.wisc.edu>
Fixes: 88069f77e1ac5 (NFSv41: Fix a potential state leakage when...)
Cc: stable@vger.kernel.org # 2.6.33+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs4proc.c