From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [Patch 14/44] fsck.gfs2: Ask to reclaim unlinked meta on a per-rgrp basis only
Date: Thu, 11 Aug 2011 17:04:20 -0400 (EDT) [thread overview]
Message-ID: <494574614.544714.1313096660001.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com> (raw)
From 0307db694e7316ab93071239704428ba5e346fcb Mon Sep 17 00:00:00 2001
From: Bob Peterson <rpeterso@redhat.com>
Date: Mon, 8 Aug 2011 15:16:01 -0500
Subject: [PATCH 14/44] fsck.gfs2: Ask to reclaim unlinked meta on a per-rgrp
basis 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#675723
---
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 18d13cc..c0e83a7 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -195,7 +195,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;
@@ -234,9 +234,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))
--
1.7.4.4
next reply other threads:[~2011-08-11 21:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-11 21:04 Bob Peterson [this message]
2011-08-12 9:30 ` [Cluster-devel] [Patch 14/44] fsck.gfs2: Ask to reclaim unlinked meta on a per-rgrp basis only Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=494574614.544714.1313096660001.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com \
--to=rpeterso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).