2013-12-17 16:16:02 +00:00
|
|
|
Bugzilla: 754518
|
|
|
|
Upstream-status: Fedora mustard (might be worth dropping...)
|
|
|
|
|
2012-02-10 19:56:13 +00:00
|
|
|
--- a/drivers/scsi/sd.c
|
|
|
|
+++ a/drivers/scsi/sd.c
|
|
|
|
@@ -2362,13 +2362,18 @@ static int sd_try_extended_inquiry(struct scsi_device *sdp)
|
|
|
|
static int sd_revalidate_disk(struct gendisk *disk)
|
|
|
|
{
|
|
|
|
struct scsi_disk *sdkp = scsi_disk(disk);
|
|
|
|
- struct scsi_device *sdp = sdkp->device;
|
|
|
|
+ struct scsi_device *sdp;
|
|
|
|
unsigned char *buffer;
|
|
|
|
unsigned flush = 0;
|
|
|
|
|
|
|
|
SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp,
|
|
|
|
"sd_revalidate_disk\n"));
|
|
|
|
|
2012-02-14 16:01:47 +00:00
|
|
|
+ if (WARN_ONCE((!sdkp), "Invalid scsi_disk from %p\n", disk))
|
2012-02-10 19:56:13 +00:00
|
|
|
+ goto out;
|
|
|
|
+
|
|
|
|
+ sdp = sdkp->device;
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* If the device is offline, don't try and read capacity or any
|
|
|
|
* of the other niceties.
|