[lkml]   [2006]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/3] block layer: early detection of medium not present
On Tue, 2006-06-06 at 11:26 -0400, Alan Stern wrote:
> When the block layer checks for new media in a drive, it uses a two-step
> procedure: First it checks for media change and then it revalidates the
> disk. When no medium is present the second step fails.
> However some drivers (such as the SCSI disk driver) are capable of
> detecting medium-not-present as part of the media-changed check. Doing so
> will reduce by a factor of 2 or more the amount of work done by tasks
> which, like hald, constantly poll empty drives.
> This patch (as694) changes the block layer core to make it recognize a
> -ENOMEDIUM error return from the media_changed method. A follow-on patch
> makes the sd driver return this code when no medium is present.

I'm not sure there's enough buy in to make this change yet ... our media
change handling is incredibly (and quite possibly far too) complex.

As documented in Documentation/cdrom/cdrom-standard.tex, the return
codes for media change are either 0 or 1.

Personally, I can't see a problem with overloading the true return to
have more information that the error codes provide, but before we do
this we need the buy in of the cdrom layer, since that's where this
handling came from, and we need to update the documents to reflect the
new behaviour ... someone also needs to consider what changes should be
made in the cdrom layer for this (and whether this is actually the
correct way to do this from the point of view of CDs).


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-06-09 05:54    [W:0.026 / U:7.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site