RE: System reboot hangs due to race against devices_kset->list triggered by SCSI FC workqueue

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

 



On Thu, 4 Mar 2010, Hugh Daschbach wrote:

> Apparently I still don't understand your original suggestion.  I'd
> prefer to, especially if it leads to a simpler fix.  The loop in
> device_shutdown() looks something like:
> 
>        struct device *dev, *devn;
> 
>         list_for_each_entry_safe_reverse(dev, devn, &devices_kset->list,
>                                 kobj.entry) {
>                 if (dev->bus && dev->bus->shutdown) {
>                         dev->bus->shutdown(dev);
>                 } else if (dev->driver && dev->driver->shutdown) {
>                         dev->driver->shutdown(dev);
>                 }
>         }
> 
> *dev gets delinked kobj_kset_leave() indirectly called from
> dev->*->shutdown(dev).  This is protected by the spinlock.
> 
> The secondary thread similarly calls kobj_kset_leave().  But when the
> secondary thread calls the shutdown routine for the device that devn
> points to, the loop hangs.
> 
> Is there some way I can detect that devn no longer points to a valid
> device upon return from dev->*->shutdown(dev)?  Or, where else can I
> look to better understand your suggestion?

Did you read the patch in my previous message?  You didn't quote it.  
It removes the devn variable, so the problem you're worried about
cannot occur.

Alan Stern

--
To unsubscribe from this list: 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