Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752702AbdHIMaB (ORCPT ); Wed, 9 Aug 2017 08:30:01 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:35955 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751917AbdHIM37 (ORCPT ); Wed, 9 Aug 2017 08:29:59 -0400 MIME-Version: 1.0 In-Reply-To: <20170809104202.30959-1-vkuznets@redhat.com> References: <20170809104202.30959-1-vkuznets@redhat.com> From: =?UTF-8?B?5ZCJ6Jek6Iux5piO?= Date: Wed, 9 Aug 2017 21:29:38 +0900 Message-ID: Subject: Re: [PATCH RFC net-next] net: Allow name change of IFF_UP interfaces To: Vitaly Kuznetsov Cc: network dev , Linux Kernel Mailing List , "David S. Miller" , Eric Dumazet , Stephen Hemminger Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1406 Lines: 42 2017-08-09 19:42 GMT+09:00 Vitaly Kuznetsov : > What happens is: __netvsc_vf_setup() does dev_open() for the VF device and > the consecutive dev_change_name() fails with -EBUSY because of the > (dev->flags & IFF_UP) check. The history of this code predates git so I > wasn't able to figure out when and why the check was added, everything > seems to work fine without it. dev_change_name() has only two call sites, > both hold rtnl_lock. > > Signed-off-by: Vitaly Kuznetsov > --- > RFC: I'm probably miossing something obvious and the check can't be just > dropped. Stephen suggested a different solution to the isuue: > https://www.spinics.net/lists/netdev/msg448243.html but it has its own > drawbacks. > --- > net/core/dev.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 1d75499add72..c608e233a78a 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1186,8 +1186,6 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > - return -EBUSY; > > write_seqcount_begin(&devnet_rename_seq); I think people expect the name won't change while up and I don't think it is a good idea to allow changing the name while the interface is up. --yoshfuji > > -- > 2.13.4 >