From owner-freebsd-stable@FreeBSD.ORG Tue Mar 6 02:23:56 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2654216A400 for ; Tue, 6 Mar 2007 02:23:56 +0000 (UTC) (envelope-from craig@feniz.gank.org) Received: from ion.gank.org (ion.gank.org [69.55.238.164]) by mx1.freebsd.org (Postfix) with ESMTP id 15EC213C494 for ; Tue, 6 Mar 2007 02:23:56 +0000 (UTC) (envelope-from craig@feniz.gank.org) Received: by ion.gank.org (Postfix, from userid 1001) id 10FD410A03; Mon, 5 Mar 2007 20:08:30 -0600 (CST) Date: Mon, 5 Mar 2007 20:08:27 -0600 From: Craig Boston To: freebsd-stable@freebsd.org Message-ID: <20070306020826.GA18228@nowhere> Mail-Followup-To: Craig Boston , freebsd-stable@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Subject: umass media size off-by-one? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2007 02:23:56 -0000 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: 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