lkml.org 
[lkml]   [2008]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.6.25-mm1 -- WARNING: at fs/sysfs/dir.c:427 sysfs_add_one+0x33/0x9a()
On Mon, Apr 21, 2008 at 6:01 PM, Miles Lane <miles.lane@gmail.com> wrote:
>
> On Mon, Apr 21, 2008 at 5:01 PM, Frederik Deweerdt <deweerdt@free.fr> wrote:
> > On Mon, Apr 21, 2008 at 02:56:52PM -0400, Miles Lane wrote:
> > > Is anyone interesting in following up on this?
> > >
> > Doesn't this
> > http://linux.derkeiler.com/Mailing-Lists/Kernel/2008-04/msg06990.html
> > fixes it?
>
> That patch seems to have some problems:
> http://groups.google.com/group/linux.kernel/browse_thread/thread/a9cfeae4ce67ee8e/2118788c3c81b2f3?#2118788c3c81b2f3
> Should I apply this instead or as well?
>
> From: Kay Sievers <kay.siev...@vrfy.org>
> Subject: sysfs: fix duplicated device number registration in /sys/dev/
>
> If the parent device has the same dev_t, we skip the registration
> for the device number at /sys/dev.
>
> Cc: Dan Williams <dan.j.willi...@intel.com>
> Cc: Greg KH <g...@kroah.com>
> Cc: Andrew Morton <a...@linux-foundation.org>
> Signed-off-by: Kay Sievers <kay.siev...@vrfy.org>
> ---
>
> core.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index de925f8..afedadb 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -821,10 +821,13 @@ int device_add(struct device *dev)
> if (error)
> goto ueventattrError;
>
> - format_dev_t(devt_str, dev->devt);
> - error = sysfs_create_link(kobj, &dev->kobj, devt_str);
> - if (error)
> - goto devtattrError;
> + /* do not create /sys/dev/ entry if parent already did */
> + if (!(dev->parent && dev->parent->devt == dev->devt)) {
> + format_dev_t(devt_str, dev->devt);
> + error = sysfs_create_link(kobj, &dev->kobj, devt_str);
> + if (error)
> + goto devtattrError;
> + }
> }
>
> error = device_add_class_symlinks(dev);
> @@ -950,8 +953,10 @@ void device_del(struct device *dev)
> if (parent)
> klist_del(&dev->knode_parent);
> if (MAJOR(dev->devt)) {
> - format_dev_t(devt_str, dev->devt);
> - sysfs_remove_link(device_to_dev_kobj(dev), devt_str);
> + if (!(parent && parent->devt == dev->devt)) {
> + format_dev_t(devt_str, dev->devt);
> + sysfs_remove_link(device_to_dev_kobj(dev), devt_str);
> + }
> device_remove_file(dev, &devt_attr);
> }
> if (dev->class) {
>
> --

Applying this patch worked for me.

Thanks!
Miles
\
 
 \ /
  Last update: 2008-04-22 00:15    [W:0.037 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site