NFSv4: Fix another bug in the close/open_downgrade code
authorTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 18 Sep 2014 15:51:32 +0000 (11:51 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:54:10 +0000 (14:54 -0700)
commita6ac6009711ee484135051ee8d7f7bc58438f2bb
tree66b40f76cbf3cc7845be6e4eaf6374d18a65db53
parent648d333d7d845d4364d0fab9d31ebb48e4641bfb
NFSv4: Fix another bug in the close/open_downgrade code

commit cd9288ffaea4359d5cfe2b8d264911506aed26a4 upstream.

James Drew reports another bug whereby the NFS client is now sending
an OPEN_DOWNGRADE in a situation where it should really have sent a
CLOSE: the client is opening the file for O_RDWR, but then trying to
do a downgrade to O_RDONLY, which is not allowed by the NFSv4 spec.

Reported-by: James Drews <drews@engr.wisc.edu>
Link: http://lkml.kernel.org/r/541AD7E5.8020409@engr.wisc.edu
Fixes: aee7af356e15 (NFSv4: Fix problems with close in the presence...)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c