Re: 2.6.16-rc1 crash in scsi_target_reap_work

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

 



 On Mon, Feb 20, Brian King wrote:

> Olaf Hering wrote:
> > 1:mon> d c0000000024cacc8
> > c0000000024cacc8 00000000dead4ead ffffffff00000000  |......N.........|
> > c0000000024cacd8 ffffffffffffffff c0000000024cace0  |.............L..|
> > c0000000024cace8 c0000000024cace0 c000000000614f68  |.....L.......aOh|
> > c0000000024cacf8 c000000000614f38 0000000000000000  |.....aO8........|
> > c0000000024cad08 0000000000000000 0000000000000000  |................|
> > c0000000024cad18 0000000000000000 0000000000000000  |................|
> > c0000000024cad28 0000000000000000 0000000000000000  |................|
> > c0000000024cad38 0000000000000000 0000000000000000  |................|
> > c0000000024cad48 0000000000000000 0000000000000000  |................|
> > c0000000024cad58 0000000000000000 0000000000000000  |................|
> > c0000000024cad68 0000000000000000 0000000000000000  |................|
> > c0000000024cad78 0000000000000000 0000000000000000  |................|
> > c0000000024cad88 0000000000000000 0000000000000000  |................|
> > c0000000024cad98 0000000000000000 0000000000000000  |................|
> > c0000000024cada8 0000000000000000 0000000000000000  |................|
> > c0000000024cadb8 0000000000000000 0000000000000000  |................|
> > c0000000024cadc8 0000000000000000 0000000000000000  |................|
> > c0000000024cadd8 0000000000000000 0000000000000000  |................|
> 
> I've now seen a couple recreates of this problem on various systems in
> our labs, and there are always a bunch of zeroes in the struct device
> in the same place as above. I wonder if perhaps the call to device_add
> is failing in scsi_alloc_target. Failure of this call is not being handled
> today. Can you give the attached patch a try? 

This fixes it, tested with plain rc3. Lots of -EEXIST, I wonder if the real bug is elsewhere.

cat /root/rocket/cranberry_full.20.log | strings | env -i  grep -w device_add | sort | uniq -c
      2 scsi_alloc_target(367): device_add for 'target0:255:107' failed with -17
      3 scsi_alloc_target(367): device_add for 'target0:255:110' failed with -17
      3 scsi_alloc_target(367): device_add for 'target0:255:114' failed with -17
      2 scsi_alloc_target(367): device_add for 'target0:255:37' failed with -17
      1 scsi_alloc_target(367): device_add for 'target0:255:39' failed with -17


@@ -361,7 +362,17 @@ static struct scsi_target *scsi_alloc_ta
        spin_unlock_irqrestore(shost->host_lock, flags);
        /* allocate and add */
        transport_setup_device(dev);
-       device_add(dev);
+       err = device_add(dev);
+       if (err) {
+               printk(KERN_EMERG "%s(%u): device_add for '%s' failed with %d\n",__FUNCTION__,__LINE__,dev->bus_id,err);
+               spin_lock_irqsave(shost->host_lock, flags);
+               list_del_init(&starget->siblings);
+               spin_unlock_irqrestore(shost->host_lock, flags);
+               transport_destroy_device(dev);
+               put_device(parent);
+               kfree(starget);
+               return NULL;
+       }
        transport_add_device(dev);

-
: 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