Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230616
b: refs/heads/master
c: 638428e
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Dec 16, 2010
1 parent b4dcc2f commit 34201bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2d9217296bfa6fdc0d3707264076e5296faffdbd
refs/heads/master: 638428ece619495edc9579b1e21493eb00f9687c
18 changes: 11 additions & 7 deletions trunk/drivers/scsi/sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,17 @@ static int sr_media_change(struct cdrom_device_info *cdi, int slot)

sshdr = kzalloc(sizeof(*sshdr), GFP_KERNEL);
retval = sr_test_unit_ready(cd->device, sshdr);
if (retval || (scsi_sense_valid(sshdr) &&
/* 0x3a is medium not present */
sshdr->asc == 0x3a)) {
/* Media not present or unable to test, unit probably not
* ready. This usually means there is no disc in the drive.
* Mark as changed, and we will figure it out later once
* the drive is available again.
/*
* Media is considered to be present if TUR succeeds or fails with
* sense data indicating something other than media-not-present
* (ASC 0x3a).
*/
if (!scsi_status_is_good(retval) &&
(!scsi_sense_valid(sshdr) || sshdr->asc == 0x3a)) {
/*
* Probably no media in the device. Mark as changed, and
* we will figure it out later once the drive is available
* again.
*/
cd->device->changed = 1;
/* This will force a flush, if called from check_disk_change */
Expand Down

0 comments on commit 34201bd

Please sign in to comment.