From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Greg KH <greg@kroah.com>, Tejun Heo <htejun@gmail.com>,
"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: recent sysfs changes cause lots of network device errors
Date: Tue, 30 Oct 2007 15:00:10 -0700 [thread overview]
Message-ID: <20071030150010.79253f01@freepuppy.rosehill> (raw)
It seems that the network device rename done by distro's
interacts badly with the code in device_rename() in 2.6.24
(post -rc1). Network devices create sysfs entries where the sd->s_name is
just a pointer over to the actual buffer in the netdevice.
Prior to calling device_rename, the code in dev_change_name() updates
the network device name field to the new name. Then when device_rename
is called it sees that the new name already exists, and dumps out a bunch
of sysfs warnings.
I already fixed the obvious case of rename to same name, so that isn't the
problem.
dev_change_name eth0 -> eth4
[ 46.029555] sysfs: duplicate filename 'eth4' can not be created
[ 46.029557] WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()
[ 46.029559]
[ 46.029560] Call Trace:
[ 46.029586] [<ffffffff802e60ff>] sysfs_add_one+0xaf/0xf0
[ 46.029590] [<ffffffff802e7113>] sysfs_create_link+0xa3/0x140
[ 46.029597] [<ffffffff803b1bb8>] device_rename+0x1d8/0x230
[ 46.029603] [<ffffffff8040af45>] dev_change_name+0xe5/0x280
[ 46.029606] [<ffffffff8040b697>] dev_ioctl+0x2b7/0x540
[ 46.029612] [<ffffffff803fc32d>] sock_ioctl+0x7d/0x250
[ 46.029618] [<ffffffff802ab33f>] do_ioctl+0x2f/0xa0
[ 46.029620] [<ffffffff802ab424>] vfs_ioctl+0x74/0x2d0
[ 46.029624] [<ffffffff8029bde5>] fd_install+0x25/0x60
[ 46.029626] [<ffffffff802ab711>] sys_ioctl+0x91/0xb0
[ 46.029631] [<ffffffff8020bbce>] system_call+0x7e/0x83
What is the proper usage mode for the rename code?
Should the underlying structure get changed first or later?
Or maybe dev_change_name should just not use device_rename
at all, and just fix the kobject itself?
device_rename() should be smart enough to:
1. not get confused if sysfs entry is already changed
2. handle the case of rename to same name correctly.
The device control code needs more regression testing before new patches
are accepted. I understand there is a strong desire to cleanup and eliminate
the class device stuff, but before going there you need to create
regression tests for all usages, and not depend on every subsystem
maintainer to make changes to keep up with your whims.
--
Stephen Hemminger <shemminger@linux-foundation.org>
next reply other threads:[~2007-10-30 22:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 22:00 Stephen Hemminger [this message]
2007-10-30 22:40 ` recent sysfs changes cause lots of network device errors Greg KH
2007-10-31 0:02 ` Rick Jones
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=20071030150010.79253f01@freepuppy.rosehill \
--to=shemminger@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=greg@kroah.com \
--cc=htejun@gmail.com \
--cc=netdev@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