NFSv4: Fix return values for nfs4_file_open()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 9 Aug 2019 19:03:11 +0000 (15:03 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Sep 2019 05:14:12 +0000 (07:14 +0200)
commit88acd562ce7c45a0839302e3fe5923ba56ea5ca7
tree8a102b0b5a044bdea002559f3d754e8d62e48bd8
parent0f24169631c0894ce6625ad9d0be48e8feffb2d7
NFSv4: Fix return values for nfs4_file_open()

[ Upstream commit 90cf500e338ab3f3c0f126ba37e36fb6a9058441 ]

Currently, we are translating RPC level errors such as timeouts,
as well as interrupts etc into EOPENSTALE, which forces a single
replay of the open attempt. What we actually want to do is
force the replay only in the cases where the returned error
indicates that the file may have changed on the server.

So the fix is to spell out the exact set of errors where we want
to return EOPENSTALE.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4file.c