All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <dlezcano@fr.ibm.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [net-2.6 patch 1/2][NETNS] fix device renaming for sysfs
Date: Wed, 04 Jun 2008 15:50:13 +0200	[thread overview]
Message-ID: <48469D95.3050703@fr.ibm.com> (raw)
In-Reply-To: <m1fxrtpg06.fsf@frodo.ebiederm.org>

Eric W. Biederman wrote:
> Daniel Lezcano <dlezcano@fr.ibm.com> writes:
> 
>> When a netdev is moved across namespaces with the 'dev_change_net_namespace' 
>> function, the 'device_rename' function is used to fixup kobject and refresh 
>> the sysfs tree. The device_rename function will call kobject_rename and this
>> one will check if there is an object with the same name and this is the case
>> because we are renaming the object with the same name.
>>
>> The use of 'device_rename' seems for me wrong because we usually don't
>> rename it but just move it across namespaces. As we just want to do a 
>> mini "netdev_[un]register", IMO the functions 'netdev_[un]register_kobject' 
>> should be used instead, like an usual network device [un]registering.
> 
> device_rename is correct.  Because doing device_del; device_add removes
> any driver specific sysfs attributes.
> 
> Causing your patch to introduce subtle driver breakage only when we
> move a network device between namespaces.  Ouch!
> 
> To support this operation we need something like device_rename that
> can preserve driver specific attributes, and generally handle
> movement between namespaces.  Since device_rename already does 99% of
> what we need it to do I found it easier to extend device_rename to
> handle this case then to introduce yet another function into the
> kobject layer.
> 
>> This patch replace device_rename by netdev_unregister_kobject, followed by
>> netdev_register_kobject.
> 
> And sysfs comes a' tumblin' down.
> My apologies for not replying sooner I just spotted this.

My fault, I should have Cc'ed you when sending the email :(
Thanks for looking at this patch.

   -- Daniel


  reply	other threads:[~2008-06-04 13:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30 21:31 [net-2.6 patch 0/2][NETNS] netns fixes Daniel Lezcano
2008-04-30 21:31 ` [net-2.6 patch 1/2][NETNS] fix device renaming for sysfs Daniel Lezcano
2008-05-03  0:01   ` David Miller
2008-06-04 11:59   ` Eric W. Biederman
2008-06-04 13:50     ` Daniel Lezcano [this message]
2008-04-30 21:31 ` [net-2.6 patch 2/2][NETNS] Fix reassembly timer to use the right namespace Daniel Lezcano
2008-05-03  0:02   ` David Miller

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=48469D95.3050703@fr.ibm.com \
    --to=dlezcano@fr.ibm.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.