mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
xfs: add missing cursor status check after xfs_inobt_get_rec
The xfs_inobt_get_rec() call in xfs_ialloc_count_ondisk fails to check the &has_record return - if the record is not found, the next conditional will read an uninitialized or stale irec. Fix that. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
90388d46b0
commit
5beb41df46
|
|
@ -2843,6 +2843,11 @@ xfs_ialloc_count_ondisk(
|
|||
error = xfs_inobt_get_rec(cur, &irec, &has_record);
|
||||
if (error)
|
||||
return error;
|
||||
if (XFS_IS_CORRUPT(cur->bc_mp, has_record != 1)) {
|
||||
xfs_btree_mark_sick(cur);
|
||||
return -EFSCORRUPTED;
|
||||
}
|
||||
|
||||
if (irec.ir_startino > high)
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user