]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/sr.c
ext4: fix online resize with mballoc
[linux-2.6-omap-h63xx.git] / drivers / scsi / sr.c
index 208565bdbe8e946c5f7c0676d72c2b04174d59fa..c82df8bd4d8931cc72d3654a74edde4e4c9dd75b 100644 (file)
@@ -178,6 +178,9 @@ int sr_test_unit_ready(struct scsi_device *sdev, struct scsi_sense_hdr *sshdr)
                the_result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL,
                                              0, sshdr, SR_TIMEOUT,
                                              retries--);
+               if (scsi_sense_valid(sshdr) &&
+                   sshdr->sense_key == UNIT_ATTENTION)
+                       sdev->changed = 1;
 
        } while (retries > 0 &&
                 (!scsi_status_is_good(the_result) ||
@@ -623,6 +626,7 @@ static int sr_probe(struct device *dev)
        cd->disk = disk;
        cd->capacity = 0x1fffff;
        cd->device->changed = 1;        /* force recheck CD type */
+       cd->previous_state = 1;
        cd->use = 1;
        cd->readcd_known = 0;
        cd->readcd_cdda = 0;