Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Mar 2007 21:37:33 -0700
From:      Scott Long <scottl@samsco.org>
To:        Craig Boston <craig@feniz.gank.org>, freebsd-stable@freebsd.org
Subject:   Re: umass media size off-by-one?
Message-ID:  <45ECF00D.3070101@samsco.org>
In-Reply-To: <20070306020826.GA18228@nowhere>
References:  <20070306020826.GA18228@nowhere>

next in thread | previous in thread | raw e-mail | index | archive | help
Craig Boston wrote:
> Hi all, I ran into this while trying to use geli to encrypt an external
> usb-2 hard drive.  It appears that sometimes the media size reported by
> umass is one sector too big.  For example:
> 
> umass0: Prolific Technology Inc. Mass Storage Device, rev 2.00/1.00, addr 2
> da0 at umass-sim0 bus 0 target 0 lun 0
> da0: <WDC WD18 00JB-00DUA0 65.1> Fixed Direct Access SCSI-0 device 
> da0: 40.000MB/s transfers
> da0: 171705MB (351651889 512 byte sectors: 255H 63S/T 21889C)
> 
> # dd if=/dev/zero of=/dev/da0 oseek=351651888 count=1
> dd: /dev/da0: Input/output error
> 1+0 records in
> 0+0 records out
> 0 bytes transferred in 0.002951 secs (0 bytes/sec)
> 
> # dd if=/dev/zero of=/dev/da0 oseek=351651887 count=1
> 1+0 records in
> 1+0 records out
> 512 bytes transferred in 0.000982 secs (521360 bytes/sec)
> 
> This is with a "high speed, power 100 mA, config 1, Mass Storage
> Device(0x3507), Prolific Technology Inc.(0x067b), rev 1.00" enclosure.
> I tested with two USB flash memory devices and those seem to report the
> correct size.
> 
> I'm currently rebuilding a kernel with USB_DEBUG to see if it's specific
> to a certain protocol and try to figure out if it's a bug in one of them
> or if the enclosure is lying.  Has anyone run into this before?
> 
> Craig

Fixed in 7-CURRENT.  Contact Warner Losh to make sure that your device
is quirked appropriately.

Scott



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45ECF00D.3070101>