Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753772AbYLSEdU (ORCPT ); Thu, 18 Dec 2008 23:33:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752532AbYLSEdL (ORCPT ); Thu, 18 Dec 2008 23:33:11 -0500 Received: from netrider.rowland.org ([192.131.102.5]:4197 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752231AbYLSEdL (ORCPT ); Thu, 18 Dec 2008 23:33:11 -0500 Date: Thu, 18 Dec 2008 23:33:09 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Alan Cox cc: Jens Axboe , Kernel development list Subject: Re: Checking a USB drive's capacity In-Reply-To: <20081218224418.01fc26a4@lxorguk.ukuu.org.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1269 Lines: 31 On Thu, 18 Dec 2008, Alan Cox wrote: > > spun up yet. Not to mention that it seems strange to read the last > > sector before reading the first! > > The SCSI CD code deals with this by spotting the error is close to the > end and of particular types then interpreting it and adjusting the volume > size. This is done because the size value for a CD-R/RW is imprecise. Although it may be okay for CDs, I suspect that approach won't work for disks. For one thing, this would cause the volume size to change after the partition table had been read and interpreted, which doesn't seem like a good idea. For another, it would cause the location of the "last" sector to change in mid-flight, which might well cause problems for programs like vol_id and hald_probe_storage -- they need to read the last sector to determine if the volume is part of a RAID array. Now maybe these objections won't matter; the code in each case might be resilient enough to handle such changes. Do you think it could work? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/