[Cluster-devel] cluster/gfs2/edit hexedit.c

rpeterso at sourceware.org rpeterso at sourceware.org
Wed Nov 7 15:07:08 UTC 2007


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

--- cluster/gfs2/edit/hexedit.c	2007/10/18 19:56:41	1.22
+++ cluster/gfs2/edit/hexedit.c	2007/11/07 15:07:07	1.23
@@ -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);
 }
 
 /* ------------------------------------------------------------------------ */




More information about the Cluster-devel mailing list