gfs2-utils: master - gfs2_edit: Fix error message on blockalloc when outside bitmap

Bob Peterson rpeterso at fedoraproject.org
Thu Feb 3 17:09:51 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=bdaaf3f4ef1a3df196bb900ec7ade2017362569b
Commit:        bdaaf3f4ef1a3df196bb900ec7ade2017362569b
Parent:        2e5a1389b93b17013445bda32824fb8638bc8d74
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 10:35:37 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 27dbd9d..ea3ad28 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2569,6 +2569,11 @@ static void find_change_block_alloc(int *newval)
 					printf("%d\n", *newval);
 			} else {
 				type = gfs2_get_bitmap(&sbd, ablock, rgd);
+				if (type < 0) {
+					printf("-1 (block invalid or part of "
+					       "an rgrp).\n");
+					exit(-1);
+				}
 				printf("%d (%s)\n", type, allocdesc[gfs1][type]);
 			}
 			gfs2_rgrp_relse(rgd);


More information about the cluster-commits mailing list