summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-08-09 15:03:11 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-21 07:16:55 +0200
commitd7565d51af18bafd74a7e97519bb50bba0eb97aa (patch)
tree614b281b9b062ef0f86904b6926f667b66090865 /fs
parent4e5fbcb9a61581747504c9e90dd494f62379c4db (diff)
downloadlinux-stable-d7565d51af18bafd74a7e97519bb50bba0eb97aa.tar.gz
linux-stable-d7565d51af18bafd74a7e97519bb50bba0eb97aa.tar.bz2
linux-stable-d7565d51af18bafd74a7e97519bb50bba0eb97aa.zip
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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 61abbb087ed1..75d3cf86f172 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;
}
}