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

From: Alan Stern
Date: Wed Mar 03 2010 - 15:25:59 EST


On Wed, 3 Mar 2010, Hugh Daschbach wrote:

> > Can't we just protect the list? What is wanting to write to the list
> > while shutdown is happening?
>
> Indeed, Alan suggested holding the kset spinlock while iterating the
> list. Unfortunately, the device shutdown routines may sleep. At least
> the SCSI sd_shutdown routine issues I/O to the device as part of
> flushing device caches. I would guess other subsystems sleep as well.

What I meant was that you should hold the spinlock while finding and
unlinking the last device on the list. Clearly you shouldn't hold it
while calling the device shutdown routine.

> I'll try klist. That looks like a good mediator between traversal and
> removal.

Yes, it removes a lot of difficulties.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/