Skip to content

Commit

Permalink
nfs: propagate readlink errors in nfs_symlink_filler
Browse files Browse the repository at this point in the history
There is an inherent race where a symlink file may have been overriden
(by a different client) between lookup and readlink, resulting in a
spurious EIO error returned to userspace. Fix this by propagating back
ESTALE errors such that the vfs will retry the lookup/get_link (similar
to nfs4_file_open) at least once.

Cc: Dan Aloni <dan.aloni@vastdata.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Sagi Grimberg authored and Trond Myklebust committed May 22, 2024
1 parent 6cbe14f commit 134d0b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static int nfs_symlink_filler(struct file *file, struct folio *folio)
error:
folio_set_error(folio);
folio_unlock(folio);
return -EIO;
return error;
}

static const char *nfs_get_link(struct dentry *dentry,
Expand Down

0 comments on commit 134d0b3

Please sign in to comment.