summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-08-09 12:15:07 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-21 07:18:30 +0200
commitd29a04e98cdb2f17b64b51d5dcf5a6848e1ba2e5 (patch)
treebf439f58d1f294165d7fc8da38274a5d3755bfd9 /fs/nfs
parentb8cb57c86f936b3a629d0e15819400a942c6831c (diff)
downloadlinux-stable-d29a04e98cdb2f17b64b51d5dcf5a6848e1ba2e5.tar.gz
linux-stable-d29a04e98cdb2f17b64b51d5dcf5a6848e1ba2e5.tar.bz2
linux-stable-d29a04e98cdb2f17b64b51d5dcf5a6848e1ba2e5.zip
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 9f44ddc34c7b..3321cc7a7ead 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1483,7 +1483,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;
}