Skip to contentSkip to conversation

Error message from device_rename in drivers/base/core.c

PATCH Larry Finger 5 participants 12 messages Aug 8, 2007 Driver core

lore
Share & tools
lore
#0 lore raw

I am getting the following error message from drivers/base/core.c:

net eth1: device_rename: sysfs_create_symlink failed (-17)

Upon investigation, the call generating the error is renaming 'eth1' to 'eth1'. The following patch suppresses the error.

drivers/base/core.c +1 -1
Index: wireless-dev/drivers/base/core.c
===================================================================
@@ -1256,7 +1256,7 @@ int device_rename(struct device *dev, ch
 		sysfs_remove_link(&dev->class->subsys.kobj, old_device_name);
 		error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
 					  dev->bus_id);
-		if (error) {
+		if (error && memcmp(dev->bus_id, new_name, sizeof(new_name))) {
 			/* Uh... how to unravel this if restoring can fail? */
 			dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n",
 				__FUNCTION__, error);

Larry

#1 lore raw

From: Larry Finger <[email protected]>
Date: Tue, 07 Aug 2007 23:17:23 -0500

Quoted 6 lines

I am getting the following error message from drivers/base/core.c:

net eth1: device_rename: sysfs_create_symlink failed (-17)

Upon investigation, the call generating the error is renaming 'eth1' to 'eth1'. The following patch suppresses the error.

I think this check belongs in udev not in the kernel. Thankfully this message at least tells us it is happening, please don't remove it.

I'm pretty sure it's UDEV doing this, and it should not try to rename a netdevice to what it already is named.

#2 lore raw
Quoted 7 lines · David Miller

From: Larry Finger <[email protected]>
Date: Tue, 07 Aug 2007 23:17:23 -0500

Quoted 4 lines

I am getting the following error message from drivers/base/core.c:

net eth1: device_rename: sysfs_create_symlink failed (-17)

Quoted 9 lines
Quoted 1 line

Upon investigation, the call generating the error is renaming 'eth1' to 'eth1'. The following patch suppresses the error.

I think this check belongs in udev not in the kernel. Thankfully this message at least tells us it is happening, please don't remove it.

I'm pretty sure it's UDEV doing this, and it should not try to rename a netdevice to what it already is named.

Yes, it is most likely coming from udev. Do you know who maintains udev? Google didn't give an answer in the first two pages.

Thanks,

Larry

#3 lore raw

From: Larry Finger <[email protected]>
Date: Tue, 07 Aug 2007 23:52:34 -0500

Quoted 2 lines

Yes, it is most likely coming from udev. Do you know who maintains udev? Google didn't give an answer in the first two pages.

I may be mis-remembering but I thought Greg KH was at the helm at least at one point.

#4 lore raw
Quoted 9 lines · David Miller

From: Larry Finger <[email protected]>
Date: Tue, 07 Aug 2007 23:52:34 -0500

Quoted 2 lines

Yes, it is most likely coming from udev. Do you know who maintains udev? Google didn't give an answer in the first two pages.

I may be mis-remembering but I thought Greg KH was at the helm at least at one point.

Between the previous message and this one, I found a link that lists him as one of the authors. I'll ping him about the "problem". Thanks for your help.

Larry

#5 lore raw
In reply to Larry Finger
Quoted 15 lines · Larry Finger
Quoted 14 lines · David Miller

From: Larry Finger <[email protected]>
Date: Tue, 07 Aug 2007 23:17:23 -0500

Quoted 6 lines

I am getting the following error message from drivers/base/core.c:

net eth1: device_rename: sysfs_create_symlink failed (-17)

Upon investigation, the call generating the error is renaming 'eth1' to 'eth1'. The following patch suppresses the error.

I think this check belongs in udev not in the kernel. Thankfully this message at least tells us it is happening, please don't remove it.

Quoted 6 lines
Quoted 3 lines

I'm pretty sure it's UDEV doing this, and it should not try to rename a netdevice to what it already is named.

Yes, it is most likely coming from udev. Do you know who maintains udev? Google didn't give an answer in the first two pages.

Kay Sievers. Se contact details on his udev page here:
http://vrfy.org/log/recent-state-of-udev.html

Sam

#6 lore raw
In reply to David Miller
Quoted 5 lines · David Miller

From: Larry Finger <[email protected]>
Date: Tue, 07 Aug 2007 23:17:23 -0500

Quoted 2 lines

I am getting the following error message from drivers/base/core.c:

Quoted 8 lines
Quoted 4 lines

net eth1: device_rename: sysfs_create_symlink failed (-17)

Upon investigation, the call generating the error is renaming 'eth1' to 'eth1'. The following patch suppresses the error.

I think this check belongs in udev not in the kernel. Thankfully this message at least tells us it is happening, please don't remove it.

Hm, device_rename() could alternatively just return success if dev->bus_id and new_name are the same.

Quoted 3 lines

I'm pretty sure it's UDEV doing this, and it should not try to rename a netdevice to what it already is named.

But it shouldn't cause an error either :)

#7 lore raw
Quoted 9 lines · Cornelia Huck
Quoted 3 lines · David Miller

I think this check belongs in udev not in the kernel. Thankfully this message at least tells us it is happening, please don't remove it.

Hm, device_rename() could alternatively just return success if dev->bus_id and new_name are the same.

That is what my proposed patch did. One could argue that the test should come before the failure, not after, but the effect is the same.

Quoted 4 lines
Quoted 2 lines

I'm pretty sure it's UDEV doing this, and it should not try to rename a netdevice to what it already is named.

But it shouldn't cause an error either :)

I agree with you, but you and David can fight it out. While finding out where to ask/complain about udev, I had a private communication with GregKH. He thinks that a patch to fix this has already been pushed through Linus. As Linville's wireless-dev tree is a little behind, I'm waiting to see if it gets fixed here by 2.6.23-rc3. If not, I'll talk to the udev/hotplug folks.

#8 lore raw
Quoted 17 lines · Larry Finger
Quoted 9 lines · Cornelia Huck
Quoted 3 lines · David Miller

I think this check belongs in udev not in the kernel. Thankfully this message at least tells us it is happening, please don't remove it.

Hm, device_rename() could alternatively just return success if dev->bus_id and new_name are the same.

That is what my proposed patch did. One could argue that the test should come before the failure, not after, but the effect is the same.

Quoted 3 lines
Quoted 2 lines

I'm pretty sure it's UDEV doing this, and it should not try to rename a netdevice to what it already is named.

Quoted 6 lines
Quoted 1 line

But it shouldn't cause an error either :)

I agree with you, but you and David can fight it out. While finding out where to ask/complain about udev, I had a private communication with GregKH. He thinks that a patch to fix this has already been pushed through Linus. As Linville's wireless-dev tree is a little behind, I'm waiting to see if it gets fixed here by 2.6.23-rc3. If not, I'll talk to the udev/hotplug folks.

Hmm, I can not immediately see how udev could request the renaming to the same name:

  /* look if we want to change the name of the netif */
  if (strcmp(udev->name, udev->dev->kernel) != 0) {
    ...
    retval = rename_netif(udev);
    ...
  }

What udev version is it and which distro and version?

Kay

#9 lore raw
Quoted 9 lines · Kay Sievers
Quoted 4 lines · Larry Finger

I agree with you, but you and David can fight it out. While finding out where to ask/complain about udev, I had a private communication with GregKH. He thinks that a patch to fix this has already been pushed through Linus. As Linville's wireless-dev tree is a little behind, I'm waiting to see if it gets fixed here by 2.6.23-rc3. If not, I'll talk to the udev/hotplug folks.

Hmm, I can not immediately see how udev could request the renaming to the same name:

Quoted 8 lines
  /* look if we want to change the name of the netif */
  if (strcmp(udev->name, udev->dev->kernel) != 0) {
    ...
    retval = rename_netif(udev);
    ...
  }

What udev version is it and which distro and version?

My distro is openSUSE 10.2, which is fully patched/updated. According to YaST, I'm using version 103-12 x86_64. My kernel is 2.6.23-rc2 from John Linville's git tree - I run bcm43xx-mac80211.

Larry

#10 lore raw
Quoted 17 lines · Larry Finger
Quoted 16 lines · Kay Sievers
Quoted 4 lines · Larry Finger

I agree with you, but you and David can fight it out. While finding out where to ask/complain about udev, I had a private communication with GregKH. He thinks that a patch to fix this has already been pushed through Linus. As Linville's wireless-dev tree is a little behind, I'm waiting to see if it gets fixed here by 2.6.23-rc3. If not, I'll talk to the udev/hotplug folks.

Hmm, I can not immediately see how udev could request the renaming to the same name:

  /* look if we want to change the name of the netif */
  if (strcmp(udev->name, udev->dev->kernel) != 0) {
    ...
    retval = rename_netif(udev);
    ...
  }
Quoted 4 lines
Quoted 1 line

What udev version is it and which distro and version?

My distro is openSUSE 10.2, which is fully patched/updated. According to YaST, I'm using version 103-12 x86_64. My kernel is 2.6.23-rc2 from John Linville's git tree - I run bcm43xx-mac80211.

Oh, that's likely a bug in the SUSE versions of the persistent net interface rules. It is calling ifrename when it needs to swap interface names (temp rename to free the target name), that logic which may have that bug.
For the next SUSE release, it is replaced by the (now available) upstream stuff from the udev tree, which most distros use now, and which should not have that problem.

Thanks,
Kay

#11 lore raw
Quoted 20 lines · Kay Sievers
Quoted 16 lines · Larry Finger
Quoted 15 lines · Kay Sievers
Quoted 4 lines · Larry Finger

I agree with you, but you and David can fight it out. While finding out where to ask/complain about udev, I had a private communication with GregKH. He thinks that a patch to fix this has already been pushed through Linus. As Linville's wireless-dev tree is a little behind, I'm waiting to see if it gets fixed here by 2.6.23-rc3. If not, I'll talk to the udev/hotplug folks.

Hmm, I can not immediately see how udev could request the renaming to the same name:

  /* look if we want to change the name of the netif */
  if (strcmp(udev->name, udev->dev->kernel) != 0) {
    ...
    retval = rename_netif(udev);
    ...
  }
Quoted 2 lines
Quoted 1 line

What udev version is it and which distro and version?

My distro is openSUSE 10.2, which is fully patched/updated. According to YaST, I'm using version 103-12 x86_64. My kernel is 2.6.23-rc2 from John Linville's git tree - I run bcm43xx-mac80211.

Quoted 7 lines

Oh, that's likely a bug in the SUSE versions of the persistent net interface rules. It is calling ifrename when it needs to swap interface names (temp rename to free the target name), that logic which may have that bug.
For the next SUSE release, it is replaced by the (now available) upstream stuff from the udev tree, which most distros use now, and which should not have that problem.

Thanks for the explanation. I'll ignore the message - it doesn't cause any problems anyway, and I'll expect it to go away when openSUSE 10.3 comes out in October. I think I'll post a bug report with SUSE just to make sure it gets fixed.

Larry