NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/41873: vnd >2GB reported as negative size

>Number:         41873
>Category:       kern
>Synopsis:       vnconfig -vc prints negative size for vnds > 2GB
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 11 21:00:00 +0000 2009
>Originator:     Christoph Badura
>Release:        NetBSD 5.0_STABLE
netbsd bozotic software testing labs
System: NetBSD sanctioned-parts-list 5.0_STABLE NetBSD 5.0_STABLE (pe1400-dom0) 
#1: Wed Jul 22 19:43:01 UTC 2009 
bad@arbitrary:/m/src/sys/arch/i386/compile/pe1400-dom0 i386
Architecture: i386
Machine: i386
vnconfig -vc gives the size of the vnd as negative number when the size is
larger than 2GB.  E.g.:
# vnconfig -vc vnd0 zorch
/dev/rvnd0d: -1610612736 bytes on zorch

This is because vnd_size in struct vnd_ioctl is an int:
struct vnd_ioctl {
        char            *vnd_file;      /* pathname of file to mount */
        int             vnd_flags;      /* flags; see below */
        struct vndgeom  vnd_geom;       /* geometry to emulate */
        int             vnd_size;       /* (returned) size of disk */

dd if=/dev/zero of=zorch bs=1m count=2049
vnconfig -vc vnd0 zorch
make vnd_size an off_t.


Home | Main Index | Thread Index | Old Index