cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [Patch 14/44] fsck.gfs2: Ask to reclaim unlinked meta on a per-rgrp basis only
@ 2011-08-11 21:04 Bob Peterson
  2011-08-12  9:30 ` Steven Whitehouse
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2011-08-11 21:04 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [Patch 14/44] fsck.gfs2: Ask to reclaim unlinked meta on a per-rgrp basis only
  2011-08-11 21:04 [Cluster-devel] [Patch 14/44] fsck.gfs2: Ask to reclaim unlinked meta on a per-rgrp basis only Bob Peterson
@ 2011-08-12  9:30 ` Steven Whitehouse
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2011-08-12  9:30 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

This is the kind of thing that needs to be fixed up for the i18n work.
We need to try and sort out the query function such that it can take the
question alone and add suitable punctuation and (y/n) hints itself
according to the locale. Also the questions should be phrases so that "I
do" and "I don't" can be just as valid answers as yes/no.

It is probably ok like this for now, but we'll have to bear that in mind
for the future,

Steve.

On Thu, 2011-08-11 at 17:04 -0400, Bob Peterson wrote:
> >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))




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-12  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11 21:04 [Cluster-devel] [Patch 14/44] fsck.gfs2: Ask to reclaim unlinked meta on a per-rgrp basis only Bob Peterson
2011-08-12  9:30 ` Steven Whitehouse

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).