]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - repair/phase5.c
xfs_repair: don't crash on ENOSPC rebuilding a btree
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 8 Sep 2016 00:22:28 +0000 (10:22 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 8 Sep 2016 00:22:28 +0000 (10:22 +1000)
commit6761d5a4e2831dd08bc9f9b9f592a99468ea426f
treeaac3b1d8d921e8cc1f451b3d285c300e6bd7ccbd
parent4e7a824f6b34dbe0dd2e2a3870891130b937f327
xfs_repair: don't crash on ENOSPC rebuilding a btree

During btree rebuilding, the cursor setup function checks ext_ptr to
report ENOSPC problems when it grabs the first extent for the btree.
However, subsequent grabs for free space don't check ext_ptr and so we
segfault if there's no space.  Therefore, move the ENOSPC check into
the loop so that we always complain about insufficient space instead
of just crashing.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/phase5.c