FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 10-26-2010, 03:53 PM
Steven Whitehouse
 
Default gfs2_edit: Fix bitmap editing function

The bitmap editing function wasn't reading in the rgrp, so that it
would fail with a NULL pointer dereference.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index c1c7512..80cbd26 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2564,23 +2564,23 @@ static void find_change_block_alloc(int *newval)
if (ablock == sbd.sb_addr)
printf("3 (the superblock is not in the bitmap)
");
else {
- if (newval) {
- if (gfs2_set_bitmap(&sbd, ablock, *newval))
- printf("-1 (block invalid or part of an rgrp).
");
- else
- printf("%d
", *newval);
- } else {
- rgd = gfs2_blk2rgrpd(&sbd, ablock);
- if (rgd) {
- gfs2_rgrp_read(&sbd, rgd);
+ rgd = gfs2_blk2rgrpd(&sbd, ablock);
+ if (rgd) {
+ gfs2_rgrp_read(&sbd, rgd);
+ if (newval) {
+ if (gfs2_set_bitmap(&sbd, ablock, *newval))
+ printf("-1 (block invalid or part of an rgrp).
");
+ else
+ printf("%d
", *newval);
+ } else {
type = gfs2_get_bitmap(&sbd, ablock, rgd);
- gfs2_rgrp_relse(rgd);
printf("%d (%s)
", type, allocdesc[gfs1][type]);
- } else {
- gfs2_rgrp_free(&sbd.rglist);
- printf("-1 (block invalid or part of an rgrp).
");
- exit(-1);
}
+ gfs2_rgrp_relse(rgd);
+ } else {
+ gfs2_rgrp_free(&sbd.rglist);
+ printf("-1 (block invalid or part of an rgrp).
");
+ exit(-1);
}
}
gfs2_rgrp_free(&sbd.rglist);
 

Thread Tools




All times are GMT. The time now is 06:00 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org