xfs: sanity check ag header values in xrep_calc_ag_resblks
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 11 Aug 2018 00:55:57 +0000 (17:55 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 14 Aug 2018 15:17:02 +0000 (08:17 -0700)
commit1fc25f51d7c18e07e8cf935cbdd4603adfc7b3ad
tree504a881c0fe9c4eaba3f114855245f6d46b11a99
parent00d22a1c367d03f469f8e1e924b062b09b0545e8
xfs: sanity check ag header values in xrep_calc_ag_resblks

Check the values we read in from the AG headers when calculating the
block reservations for a repair transaction.  If they're obviously
wrong, substitute worst case assumptions (rather than ENOSPC on a bogus
reservation request).

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
fs/xfs/scrub/repair.c