On Wed, Feb 8, 2017 at 4:08 PM, James Bottomley
<james.bottom...@hansenpartnership.com> wrote:
> On Mon, 2017-02-06 at 21:42 -0800, Dan Williams wrote:
[..]
>> ...but it reproduces on current mainline with the same config. I
>> haven't spotted what makes scsi_debug behave like this.
>
> Looking at the config, it's a static debug with report luns enabled.
>  Is it as simple as the fact that we probe lun 0 manually to see if the
> target exists, but then we don't account for the fact that we already
> did this, so if it turns up again in the report lun scan, we'll probe
> it again leading to a double add.  If that theory is correct, this may
> be the fix (compile tested only).
>
> James
>
> ---
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 6f7128f..ba4be08 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -1441,6 +1441,10 @@ static int scsi_report_lun_scan(struct scsi_target 
> *starget, int bflags,
>         for (lunp = &lun_data[1]; lunp <= &lun_data[num_luns]; lunp++) {
>                 lun = scsilun_to_int(lunp);
>
> +               if (lun == 0)
> +                       /* already scanned LUN 0 */
> +                       continue;
> +
>                 if (lun > sdev->host->max_lun) {
>                         sdev_printk(KERN_WARNING, sdev,
>                                     "lun%llu has a LUN larger than"

I gave this a shot on top of linux-next, but still hit the failure.
Log attached.

Attachment: log
Description: Binary data

Reply via email to