On 09/26/2014 10:14 AM, Christoph Hellwig wrote:
> Looks fine to me, just want a cross check from Martin or Hannes.
> 
> On Thu, Sep 25, 2014 at 03:32:20PM +0300, Dolev Raviv wrote:
>> From: Subhash Jadavani <subha...@codeaurora.org>
>>
>> If LLD has added scsi device (by calling scsi_add_device) before scheduling
>> async scsi_scan_host then scsi_finish_async_scan() will end up calling
>> scsi_sysfs_add_sdev for scsi device which was already added by LLD.
>> This patch fixes this issue by skipping the call to scsi_sysfs_add_sdev()
>> if it's already visible to rest of the kernel.
>>
>> Signed-off-by: Subhash Jadavani <subha...@codeaurora.org>
>> Signed-off-by: Dolev Raviv <dra...@codeaurora.org>
>>
>> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
>> index 1095d5a..c6c5716 100644
>> --- a/drivers/scsi/scsi_scan.c
>> +++ b/drivers/scsi/scsi_scan.c
>> @@ -1746,6 +1746,9 @@ static void scsi_sysfs_add_devices(struct Scsi_Host 
>> *shost)
>>              /* target removed before the device could be added */
>>              if (sdev->sdev_state == SDEV_DEL)
>>                      continue;
>> +            /* If device is already visible, skip adding it to sysfs */
>> +            if (sdev->is_visible)
>> +                    continue;
>>              if (!scsi_host_scan_allowed(shost) ||
>>                  scsi_sysfs_add_sdev(sdev) != 0)
>>                      __scsi_remove_device(sdev);
>> -- 
>> 1.8.5.2
>> -- 
>> QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
>> of Code Aurora Forum, hosted by The Linux Foundation
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> ---end quoted text---
> --
Looks okay.

Reviewed-by: Hannes Reinecke <h...@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                   zSeries & Storage
h...@suse.de                          +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to