summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-08-09 19:15:07 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-21 08:16:56 +0300
commit4ac4f4716fba119a16b6a3ebe6bf345b9a32258b (patch)
treeada943650ce23e221e39b1d585181d9a7d7b342f /fs/nfs
parentd7565d51af18bafd74a7e97519bb50bba0eb97aa (diff)
downloadlinux-4ac4f4716fba119a16b6a3ebe6bf345b9a32258b.tar.xz
NFSv4: Fix return value in nfs_finish_open()
[ Upstream commit 9821421a291b548ef4369c6998745baa36ddecd5 ] If the file turns out to be of the wrong type after opening, we want to revalidate the path and retry, so return EOPENSTALE rather than ESTALE. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 71b2e390becf..b8d686087952 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1486,7 +1486,7 @@ static int nfs_finish_open(struct nfs_open_context *ctx,
if (S_ISREG(file->f_path.dentry->d_inode->i_mode))
nfs_file_set_open_context(file, ctx);
else
- err = -ESTALE;
+ err = -EOPENSTALE;
out:
return err;
}