cluster: RHEL6 - gfs2_edit: Fix error message on blockalloc when outside bitmap

Bob Peterson rpeterso at fedoraproject.org
Thu Feb 3 18:35:44 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=578af431fb74985e39ba8c3acf43459bd476947f
Commit:        578af431fb74985e39ba8c3acf43459bd476947f
Parent:        0bfad0d0504aa0c2a2cfa973d79367f3208f8c04
Author:        Bob Peterson <rpeterso at redhat.com>
AuthorDate:    Thu Feb 3 10:35:37 2011 -0600
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Thu Feb 3 11:32:27 2011 -0600

gfs2_edit: Fix error message on blockalloc when outside bitmap

If you specify gfs2_edit <block> blockalloc X and the block is
part of the rgrp or bitmaps, it was not giving a proper error
message.  This patch adds an error message.

rhbz#674843
---
 gfs2/edit/hexedit.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index bb59758..2a88a40 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2568,6 +2568,11 @@ static void find_change_block_alloc(int *newval)
 				gfs2_rgrp_read(&sbd, rgd);
 				type = gfs2_get_bitmap(&sbd, ablock, rgd);
 				gfs2_rgrp_relse(rgd);
+				if (type < 0) {
+					printf("-1 (block invalid or part of "
+					       "an rgrp).\n");
+					exit(-1);
+				}
 				printf("%d (%s)\n", type, allocdesc[gfs1][type]);
 			} else {
 				gfs2_rgrp_free(&sbd.rglist);


More information about the cluster-commits mailing list