Re: [PATCH 05/21] xfs: distinguish between corrupt inode and invalid inum in xfs_scrub_get_inode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 22, 2017 at 04:43:20PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> In xfs_scrub_get_inode, we don't do a good enough job distinguishing
> EINVAL returns from xfs_iget w/ IGET_UNTRUSTED -- this can happen if the
> passed in inode number is invalid (past eofs, inobt says it isn't an
> inode) or if the inum is actually valid but the inode buffer fails
> verifier.  In the first case we still want to return ENOENT, but in the
> second case we want to capture the corruption error.
> 
> Therefore, if xfs_iget returns EINVAL, try the raw imap lookup.  If that
> succeeds, we conclude it's a corruption error, otherwise we just bounce
> out to userspace.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

Looks fine - it's in an error path so isn't going to affect anything
in the common "everything is fine" case.

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux