Skip to contentSkip to conversation

cluster/gfs2/edit hexedit.c

Cluster-devel [email protected] 1 participant 1 message Nov 7, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: rpeterso at sourceware.org 2007-11-07 15:07:08

Modified files:
gfs2/edit : hexedit.c

Log message:
Fix a divide by zero if the target isn't a gfs or gfs2 file system.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.c.diff?cvsroot=cluster&r1=1.22&r2=1.23

gfs2/edit/hexedit.c +3 -1
@@ -1322,7 +1322,9 @@
 	else
 		gfs1 = FALSE;
 	bufsize = sbd.sd_sb.sb_bsize;
-	block = 0x10 * (4096 / bufsize);
+	if (!bufsize)
+		bufsize = GFS2_DEFAULT_BSIZE;
+	block = 0x10 * (GFS2_DEFAULT_BSIZE / bufsize);
 }
 
 /* ------------------------------------------------------------------------ */