mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Miles Lane" <miles.lane@gmail.com>
To: "Frederik Deweerdt" <deweerdt@free.fr>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>, "Greg KH" <gregkh@suse.de>,
	"Kay Sievers" <kay.sievers@vrfy.org>
Subject: Re: 2.6.25-mm1 -- WARNING: at fs/sysfs/dir.c:427 sysfs_add_one+0x33/0x9a()
Date: Mon, 21 Apr 2008 18:12:39 -0400	[thread overview]
Message-ID: <a44ae5cd0804211512x29c449c2v9151e6377037c859@mail.gmail.com> (raw)
In-Reply-To: <a44ae5cd0804211501s7c269239qfee76726e3627d6b@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 2856 bytes --]

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ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2008-04-21 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-18 18:24 Miles Lane
2008-04-21 18:56 ` Miles Lane
2008-04-21 21:01   ` Frederik Deweerdt
2008-04-21 22:01     ` Miles Lane
2008-04-21 22:12       ` Miles Lane [this message]
2008-04-21 21:44   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a44ae5cd0804211512x29c449c2v9151e6377037c859@mail.gmail.com \
    --to=miles.lane@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=deweerdt@free.fr \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®