NFSv4: Don't clear the open state when we just did an OPEN_DOWNGRADE
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 26 Aug 2014 02:09:08 +0000 (22:09 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 26 Aug 2014 20:17:48 +0000 (16:17 -0400)
commit412f6c4c26fb1eba8844290663837561ac53fa6e
tree51fedde9765c9060328cd2d190cc634784234bf2
parentaee7af356e151494d5014f57b33460b162f181b5
NFSv4: Don't clear the open state when we just did an OPEN_DOWNGRADE

If we did an OPEN_DOWNGRADE, then the right thing to do on success, is
to apply the new open mode to the struct nfs4_state. Instead, we were
unconditionally clearing the state, making it appear to our state
machinery as if we had just performed a CLOSE.

Fixes: 226056c5c312b (NFSv4: Use correct locking when updating nfs4_state...)
Cc: stable@vger.kernel.org # 3.15+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs4proc.c