[PATCH] incorrect mediasize calculation in ips driver

From: YONETANI Tomokazu <t-yonetani_at_ergobrains.co.jp>
Date: Mon, 22 Sep 2003 17:26:56 +0900
Hello.
While trying to install recent snapshot of -CURRENT on Netfinity 6000R,
sysinstall and other tools reported the size of RAID partition much smaller
than expected.
After looking into source code, I noticed a small bug in calculation
of d_mediasize:

Index: ips_disk.c
===================================================================
RCS file: /home/cvs/freebsd/src/sys/dev/ips/ips_disk.c,v
retrieving revision 1.3
diff -u -r1.3 ips_disk.c
--- ips_disk.c	24 Aug 2003 17:49:14 -0000	1.3
+++ ips_disk.c	22 Sep 2003 07:19:46 -0000
_at__at_ -139,7 +139,7 _at__at_
       		dsc->ipsd_disk.d_fwsectors = IPS_COMP_SECTORS;
    	}
 	dsc->ipsd_disk.d_sectorsize = IPS_BLKSIZE;
-	dsc->ipsd_disk.d_mediasize = totalsectors * IPS_BLKSIZE;
+	dsc->ipsd_disk.d_mediasize = (off_t)totalsectors * IPS_BLKSIZE;
 	disk_create(dsc->unit, &dsc->ipsd_disk, 0, NULL, NULL);
 
 	device_printf(dev, "Logical Drive  (%dMB)\n",

Regards.
-- 
YONETANI Tomokazu / Ergo-Brains Inc.
Received on Sun Sep 21 2003 - 23:27:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:23 UTC