fsck.gfs2: allow rindex recovery when too many segments
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 fsck.gfs2: allow rindex recovery when too many segments
Hi,
Patch 0103dc0 (fsck.gfs2: Detect multiple rgrp grow segments) added an array of rgrp segments. If it found too many segments, it threw up its hands and gave up and refused to try to fix it. But in most cases, proceeding to fix the rgrps won't cause any harm, since the rgrps are checked for integrity anyway. This patch allows fsck to try to fix the rgrp corruption, even after the maximum number of rgrp segments has been reached.
Signed-off-by Bob Peterson <[email protected]>
---
gfs2/fsck/rgrepair.c +2 -4
@@ -230,9 +230,8 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array, }if (gsegment >=MAX_RGSEGMENTS ) {log_err (_ ("Maximum number of rgrp grow segments reached.\n" )); -log_err (_ ("This file system cannot be repaired with fsck.\n" )); - gsegment =0 ; - goto out; +log_err (_ ("This file system has more than %d resource " +"group segments.\n" ),MAX_RGSEGMENTS ); }/* -------------------------------------------------------------- */ /* Sanity-check our first_rg_dist. If RG #2 got nuked, the */
@@ -260,7 +259,6 @@ static int find_shortest_rgdist(struct gfs2_sbd *sdp, uint64_t *dist_array, (unsigned long long)*dist_array); }/* if first RG distance is within tolerance */ -out:gfs2_special_free (&false_rgrps);return gsegment; }