Re: [PATCH] driver core: delete virtual directory onclass_unregister()

From: Cornelia Huck
Date: Tue Nov 21 2006 - 10:09:33 EST


On Tue, 21 Nov 2006 18:58:53 +0900,
Akinobu Mita <akinobu.mita@xxxxxxxxx> wrote:

> On Mon, Nov 20, 2006 at 12:34:40PM -0800, Greg KH wrote:
> >
> > Hm, why is this not reproducable for me then without this patch?
> >
>
> I can reproduce it by reloading raw.ko on 2.6.19-rc5-mm2.
> not happened on 2.6.19-rc6.

I can reproduce this on 2.9.19-rc5-mm2 with CONFIG_SYSFS_DEPRECATED as
well.

> After unloading raw.ko, /sys/devices/virtual/raw is still exist.
> So next loading raw.ko will fail.

And as virtual_device_parent() fails to do much error checking, we end
up with /sys/devices/rawctl instead of /sys/devices/virtual/raw/rawctl.
raw_init() won't notice anything has gone wrong...

Perhaps it would make sense to create /sys/device/virtual/<class>/
already in class_register() (regardless of whether there will be any
devices for this class) and unconditionally remove it in
class_unregister()? Removing something in _unregister() which was not
created by _register() but by some unrelated action seems a bit
lopsided to me...

--
Cornelia Huck
Linux for zSeries Developer
Tel.: +49-7031-16-4837, Mail: cornelia.huck@xxxxxxxxxx
-
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/