diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-08-09 22:03:11 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-21 08:14:12 +0300 |
commit | 88acd562ce7c45a0839302e3fe5923ba56ea5ca7 (patch) | |
tree | 8a102b0b5a044bdea002559f3d754e8d62e48bd8 /fs | |
parent | 0f24169631c0894ce6625ad9d0be48e8feffb2d7 (diff) | |
download | linux-88acd562ce7c45a0839302e3fe5923ba56ea5ca7.tar.xz |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4file.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index 8a0c301b0c69..7138383382ff 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -73,13 +73,13 @@ nfs4_file_open(struct inode *inode, struct file *filp) if (IS_ERR(inode)) { err = PTR_ERR(inode); switch (err) { - case -EPERM: - case -EACCES: - case -EDQUOT: - case -ENOSPC: - case -EROFS: - goto out_put_ctx; default: + goto out_put_ctx; + case -ENOENT: + case -ESTALE: + case -EISDIR: + case -ENOTDIR: + case -ELOOP: goto out_drop; } } |