Re: [PATCH] Sanitize PQ3 device handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christoph Hellwig wrote:
>> 	res = scsi_probe_and_add_lun(starget, 0, &bflags, &sdev, rescan, NULL);
>>-	if (res == SCSI_SCAN_LUN_PRESENT) {
>>-		if (scsi_report_lun_scan(sdev, bflags, rescan) != 0)
>>+	if (res != SCSI_SCAN_NO_RESPONSE) {
>>+		if (scsi_report_lun_scan(sdev, bflags, rescan) != 0) {
>> 			/*
>> 			 * The REPORT LUN did not scan the target,
>> 			 * do a sequential scan.
>> 			 */
>>+			if (res == SCSI_SCAN_TARGET_PRESENT)
>>+				/*
>>+				 * There's a target here, but lun 0 is 
>>+				 * offline so we can't use the report_lun
>>+				 * scan.  Fall back to a sequential lun scan
>>+				 * with a bflags of SPARSELUN.
>>+				 *
>>+				 * The old code also used a default scsi level
>>+				 * of SCSI_2 which seems a bit spurious. Any
>>+				 * misbehaving device should rather be added
>>+				 * to the blacklist.
>>+				 */
>>+				bflags |= BLIST_SPARSELUN;
>>+
>> 			scsi_sequential_lun_scan(starget, bflags,
>> 				       	res, sdev->scsi_level, rescan);
> 
> If scsi_probe_and_add_lun returns SCSI_SCAN_TARGET_PRESENT sdev isn't valid at
> this point.  You should probably default to SCSI_2 for that case.
> 
How so? This is exactly the behaviour I've removed. sdev is valid even
for SCSI_SCAN_TARGET_PRESENT.
If not please show me.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@xxxxxxx
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux