From: Trond Myklebust Date: Fri, 9 Aug 2019 16:15:07 +0000 (-0400) Subject: NFSv4: Fix return value in nfs_finish_open() X-Git-Tag: v5.15~5646^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9821421a291b548ef4369c6998745baa36ddecd5;p=platform%2Fkernel%2Flinux-starfive.git NFSv4: Fix return value in nfs_finish_open() 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 --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 8d50109..0adfd884 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1487,7 +1487,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; }