NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/47879: vnd cannot handle disk image larger than 2TiB
The following reply was made to PR kern/47879; it has been noted by GNATS.
From: Takahiro HAYASHI <t-hash%abox3.so-net.ne.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: kern-bug-people%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost,
netbsd-bugs%NetBSD.org@localhost
Subject: Re: kern/47879: vnd cannot handle disk image larger than 2TiB
Date: Thu, 04 Jul 2013 00:55:33 +0900
netbsd-6 has same problem.
Following patch should fix this problem on netbsd-6.
Index: src/sys/dev/vnd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/vnd.c,v
retrieving revision 1.219.8.2
diff -u -p -r1.219.8.2 vnd.c
--- src/sys/dev/vnd.c 5 Jul 2012 18:12:46 -0000 1.219.8.2
+++ src/sys/dev/vnd.c 24 Jun 2013 11:37:56 -0000
@@ -1023,7 +1023,7 @@ vndioctl(dev_t dev, u_long cmd, void *da
struct pathbuf *pb;
struct nameidata nd;
int error, part, pmask;
- size_t geomsize;
+ uint64_t geomsize;
int fflags;
#ifdef __HAVE_OLD_DISKLABEL
struct disklabel newlabel;
@@ -2007,7 +2007,7 @@ vnd_set_properties(struct vnd_softc *vnd
geom = prop_dictionary_create();
prop_dictionary_set_uint64(geom, "sectors-per-unit",
- vnd->sc_geom.vng_nsectors * vnd->sc_geom.vng_ntracks *
+ (uint64_t)vnd->sc_geom.vng_nsectors * vnd->sc_geom.vng_ntracks *
vnd->sc_geom.vng_ncylinders);
prop_dictionary_set_uint32(geom, "sector-size",
Index: src/sys/dev/vndvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/vndvar.h,v
retrieving revision 1.31.8.1
diff -u -p -r1.31.8.1 vndvar.h
--- src/sys/dev/vndvar.h 6 Apr 2012 17:44:21 -0000 1.31.8.1
+++ src/sys/dev/vndvar.h 24 Jun 2013 11:37:56 -0000
@@ -108,7 +108,7 @@ struct vnode;
struct vnd_softc {
device_t sc_dev;
int sc_flags; /* flags */
- size_t sc_size; /* size of vnd */
+ uint64_t sc_size; /* size of vnd */
struct vnode *sc_vp; /* vnode */
kauth_cred_t sc_cred; /* credentials */
int sc_maxactive; /* max # of active requests */
--
t-hash
Home |
Main Index |
Thread Index |
Old Index