]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: push corruption -> ESTALE conversion to xfs_nfs_get_inode()
authorDave Chinner <dchinner@redhat.com>
Thu, 28 Jun 2018 20:11:58 +0000 (15:11 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:11:58 +0000 (15:11 -0500)
commit32b30f135ce27d50a6becbea949dea6958d30d80
tree212b60c7a942d0495f62ac76b5c5ca3b9f766549
parent77e17d581b9d091904f6ad174c431622b439521d
xfs: push corruption -> ESTALE conversion to xfs_nfs_get_inode()

Source kernel commit: 29cad0b3edaffb65f78f61b63cb0c43f87f98865

In xfs_imap_to_bp(), we convert a -EFSCORRUPTED error to -EINVAL if
we are doing an untrusted lookup. This is done because we need
failed filehandle lookups to report -ESTALE to the caller, and it
does this by converting -EINVAL and -ENOENT errors to -ESTALE.

The squashing of EFSCORRUPTED in imap_to_bp makes it impossible for
for xfs_iget(UNTRUSTED) callers to determine the difference between
"inode does not exist" and "corruption detected during lookup". We
realy need that distinction in places calling xfS_iget(UNTRUSTED),
so move the filehandle error case handling all the way out to
xfs_nfs_get_inode() where it is needed.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_inode_buf.c