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