cluster: STABLE3 - gfs_fsck: Don't try to convert free_meta to free if -n was specified.

Bob Peterson rpeterso at fedoraproject.org
Fri Jan 8 16:22:00 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cf9c5e17f768c02b639d57df606b7b1594eb00ab
Commit:        cf9c5e17f768c02b639d57df606b7b1594eb00ab
Parent:        89bbcb2cac174e404f3b5bbf0fce4f9da7ff59f7
Author:        Bob Peterson <rpeterso at redhat.com>
AuthorDate:    Fri Jan 8 10:17:53 2010 -0600
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Fri Jan 8 10:17:53 2010 -0600

gfs_fsck: Don't try to convert free_meta to free if -n was specified.

The code was checking free_meta blocks and counting them as errors
even if -n was specified on gfs_fsck.  But free_meta blocks aren't
technically an error and gfs_fsck's converting them to free blocks
is a convenience, so if -n was specified, don't treat them as errors.

rhbz#508978
---
 gfs/gfs_fsck/pass5.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gfs/gfs_fsck/pass5.c b/gfs/gfs_fsck/pass5.c
index d8d0768..9916664 100644
--- a/gfs/gfs_fsck/pass5.c
+++ b/gfs/gfs_fsck/pass5.c
@@ -202,10 +202,11 @@ static int check_block_status(struct fsck_sb *sbp, char *buffer, unsigned int bu
 				  rg_status, block_status, q.block_type);
 			if((rg_status == GFS_BLKST_FREEMETA) &&
 			   (block_status == GFS_BLKST_FREE)) {
-				errors_found++;
-				log_info("Converting free metadata block at %"
-					 PRIu64" to a free data block\n", block);
 				if(!sbp->opts->no) {
+					errors_found++;
+					log_info("Converting free metadata "
+						 "block at %" PRIu64 " to a "
+						 "free data block\n", block);
 					if(fs_set_bitmap(sbp, block, block_status)) {
 						log_warn("Failed to convert free metadata block to free data block at %PRIu64.\n", block);
 					}
@@ -214,6 +215,9 @@ static int check_block_status(struct fsck_sb *sbp, char *buffer, unsigned int bu
 						errors_corrected++;
 					}
 				}
+				/* If we have free_meta blocks but -n was
+				   specified, we can't convert them.  But it's
+				   also not technically an error. */
 			}
 			else {
 				const char *blockstatus[] = {"Free", "Data",


More information about the cluster-commits mailing list