Re: [PATCH 25/20] sysfs: Only support removing emtpy sysfs directories.

From: Alan Stern
Date: Mon May 25 2009 - 16:14:25 EST


On Mon, 25 May 2009, Kay Sievers wrote:

> On Mon, 2009-05-25 at 11:49 -0400, Alan Stern wrote:
> > Since this appears to be a bug in the SCSI layer, let's add some SCSI
> > people to the CC: list.
> >
> > To summarize the problem: The SCSI core tries to unregister a host
> > while its sysfs directory is still non-empty because the target hasn't
> > been unregistered yet.
>
> > Can you provide more of the context? I'd like to see the log starting
> > from when these devices were first registered.
>
> I was able to trigger it with a USB storage device only, connected to a
> hub, and I removed the hub from the host.

Okay, it's a long log dump, but useful. Evidently the problem is
caused by the fact that scsi_target_reap() is called by
scsi_device_dev_release_usercontext() instead of by
__scsi_remove_device() (both functions in drivers/scsi/scsi_sysfs.c).

There's probably a reason for this, but I don't know what it is. Maybe
James can explain.

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/