mirror of https://github.com/vitalif/e2fsprogs
e2fsck: skip clearing bad extents if bitmaps are unreadable
If the bitmaps are known to be unreadable, don't bother clearing them; just mark fsck to restart itself after pass 5, by which time the bitmaps should be fixed. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>test-maint
parent
c4c93e2d74
commit
27a129f3c2
|
@ -1816,6 +1816,26 @@ report_problem:
|
||||||
pctx->num = extent.e_len;
|
pctx->num = extent.e_len;
|
||||||
pctx->blkcount = extent.e_lblk + extent.e_len;
|
pctx->blkcount = extent.e_lblk + extent.e_len;
|
||||||
if (fix_problem(ctx, problem, pctx)) {
|
if (fix_problem(ctx, problem, pctx)) {
|
||||||
|
if (ctx->invalid_bitmaps) {
|
||||||
|
/*
|
||||||
|
* If fsck knows the bitmaps are bad,
|
||||||
|
* skip to the next extent and
|
||||||
|
* try to clear this extent again
|
||||||
|
* after fixing the bitmaps, by
|
||||||
|
* restarting fsck.
|
||||||
|
*/
|
||||||
|
pctx->errcode = ext2fs_extent_get(
|
||||||
|
ehandle,
|
||||||
|
EXT2_EXTENT_NEXT_SIB,
|
||||||
|
&extent);
|
||||||
|
ctx->flags |= E2F_FLAG_RESTART_LATER;
|
||||||
|
if (pctx->errcode ==
|
||||||
|
EXT2_ET_NO_CURRENT_NODE) {
|
||||||
|
pctx->errcode = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
e2fsck_read_bitmaps(ctx);
|
e2fsck_read_bitmaps(ctx);
|
||||||
pctx->errcode =
|
pctx->errcode =
|
||||||
ext2fs_extent_delete(ehandle, 0);
|
ext2fs_extent_delete(ehandle, 0);
|
||||||
|
|
Loading…
Reference in New Issue