]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSv4: Fix return value in nfs_finish_open()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 9 Aug 2019 16:15:07 +0000 (12:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Sep 2019 05:15:33 +0000 (07:15 +0200)
[ 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>
fs/nfs/dir.c

index 85a6fdd76e20b05e43f570c82e163222edde6670..50c181fa002510f539f06a32a23fc46bb623f408 100644 (file)
@@ -1470,7 +1470,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;
 }