public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Greg KH <greg@kroah.com>,
	USB Storage list <usb-storage@lists.one-eyed-alien.net>,
	Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
	SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: [usb-storage] [PATCH] SCSI: add check_capacity flag and sd_read_last_sector()
Date: Wed, 22 Apr 2009 21:17:52 +0200	[thread overview]
Message-ID: <20090422191752.GA24309@ub> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0904221034340.3405-100000@iolanthe.rowland.org>

On Wed, Apr 22, 2009 at 10:42:36AM -0400, Alan Stern wrote:
> This patch (as1196) adds a new scsi_device flag to tell sd.c that it
> should verify the results of READ CAPACITY by trying the read the last
> sector.

Hi Alan,

I can see why you want to do this, but allow me to mutter a bit nevertheless.
Many devices are flaky and get into strange states requiring error-recovery
or reboot when you try an I/O that they do not like.
For this reason, and also for aesthetical reasons, I would prefer never to
do I/O to a device unless user space asks for it.

(So - this would be much more work, but I would prefer a capacity value
that says "it reported this, but we have not checked yet - try an actual
I/O if you really want to know", and leave it at that until the value is
needed. Typically one needs the value (i) to check against it if one
wants to do I/O, or (ii) when user space asks for it because some fdisk type
program is invoked. In case (i) an additional read is superfluous.
In case (ii) user space asked and we try to make sure.)

Comments?

Andries


  parent reply	other threads:[~2009-04-22 19:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22 14:42 [PATCH] SCSI: add check_capacity flag and sd_read_last_sector() Alan Stern
2009-04-22 14:51 ` Matthew Wilcox
2009-04-22 17:17   ` Alan Stern
2009-04-22 15:57 ` Greg KH
2009-04-22 19:17 ` Andries E. Brouwer [this message]
2009-04-22 20:47   ` [usb-storage] " Alan Stern
2009-04-22 23:03     ` Andries E. Brouwer
2009-04-23  2:33       ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090422191752.GA24309@ub \
    --to=andries.brouwer@cwi.nl \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=greg@kroah.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mdharm-usb@one-eyed-alien.net \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox