From mboxrd@z Thu Jan 1 00:00:00 1970 From: rpeterso@sourceware.org Date: 7 Nov 2007 15:07:08 -0000 Subject: [Cluster-devel] cluster/gfs2/edit hexedit.c Message-ID: <20071107150708.20510.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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); } /* ------------------------------------------------------------------------ */