Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=6abf82b395e067... Commit: 6abf82b395e06777208324162a1f6e35da53540c Parent: d078d98871ee8065ba0421bdc76c987bf50a428e Author: Bob Peterson rpeterso@redhat.com AuthorDate: Mon Aug 8 15:16:01 2011 -0500 Committer: Bob Peterson rpeterso@redhat.com CommitterDate: Fri Apr 5 06:24:59 2013 -0700
fsck.gfs2: fsck.gfs2: Ask to reclaim unlinked meta per-rgrp only
Before this patch, fsck.gfs2 would ask for every unlinked metadata bit whether you wanted to reclaim it as free space. This patch makes it ask only once per resource group, and reports which resource group so that the user doesn't think it's stuck in an infinite loop.
rhbz#877150 --- gfs2/fsck/initialize.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c index ee33988..85500a9 100644 --- a/gfs2/fsck/initialize.c +++ b/gfs2/fsck/initialize.c @@ -205,7 +205,7 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_list *rgd, int *this_rg_bad) { uint32_t rg_free, rg_reclaimed; - int rgb, x, y, off, bytes_to_check, total_bytes_to_check; + int rgb, x, y, off, bytes_to_check, total_bytes_to_check, asked = 0; unsigned int state;
rg_free = rg_reclaimed = 0; @@ -246,9 +246,17 @@ static void check_rgrp_integrity(struct gfs2_sbd *sdp, struct rgrp_list *rgd, } /* GFS2_BLKST_UNLINKED */ *this_rg_bad = 1; - if (!(*fixit)) { - if (query(_("Okay to reclaim unlinked " - "inodes? (y/n)"))) + if (!asked) { + char msg[256]; + + asked = 1; + sprintf(msg, + _("Okay to reclaim unlinked " + "inodes in resource group " + "%lld (0x%llx)? (y/n)"), + (unsigned long long)rgd->ri.ri_addr, + (unsigned long long)rgd->ri.ri_addr); + if (query("%s", msg)) *fixit = 1; } if (!(*fixit))