All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
Cc: jiri@resnulli.us, mst@redhat.com, kubakici@wp.pl,
	sridhar.samudrala@intel.com, alexander.duyck@gmail.com,
	virtualization@lists.linux-foundation.org, liran.alon@oracle.com,
	kbuild-all@01.org, netdev@vger.kernel.org,
	si-wei liu <si-wei.liu@oracle.com>,
	boris.ostrovsky@oracle.com, davem@davemloft.net
Subject: Re: [PATCH net v4] failover: allow name change on IFF_UP slave interfaces
Date: Fri, 29 Mar 2019 21:45:56 +0800	[thread overview]
Message-ID: <201903292115.lNNVjLgD%lkp__41223.916369357$1553867234$gmane$org@intel.com> (raw)
In-Reply-To: <1553816847-28121-1-git-send-email-si-wei.liu@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 5112 bytes --]

Hi Si-Wei,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net/master]

url:    https://github.com/0day-ci/linux/commits/Si-Wei-Liu/failover-allow-name-change-on-IFF_UP-slave-interfaces/20190329-195445
config: x86_64-lkp (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   net/core/dev.c: In function 'dev_change_name':
>> net/core/dev.c:1252:48: error: passing argument 2 of 'call_netdevice_notifiers_info' from incompatible pointer type [-Werror=incompatible-pointer-types]
      call_netdevice_notifiers_info(NETDEV_CHANGE, dev,
                                                   ^~~
   net/core/dev.c:164:12: note: expected 'struct netdev_notifier_info *' but argument is of type 'struct net_device *'
    static int call_netdevice_notifiers_info(unsigned long val,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> net/core/dev.c:1252:3: error: too many arguments to function 'call_netdevice_notifiers_info'
      call_netdevice_notifiers_info(NETDEV_CHANGE, dev,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/dev.c:164:12: note: declared here
    static int call_netdevice_notifiers_info(unsigned long val,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/call_netdevice_notifiers_info +1252 net/core/dev.c

  1166	
  1167	/**
  1168	 *	dev_change_name - change name of a device
  1169	 *	@dev: device
  1170	 *	@newname: name (or format string) must be at least IFNAMSIZ
  1171	 *
  1172	 *	Change name of a device, can pass format strings "eth%d".
  1173	 *	for wildcarding.
  1174	 */
  1175	int dev_change_name(struct net_device *dev, const char *newname)
  1176	{
  1177		unsigned char old_assign_type;
  1178		char oldname[IFNAMSIZ];
  1179		int err = 0;
  1180		int ret;
  1181		struct net *net;
  1182	
  1183		ASSERT_RTNL();
  1184		BUG_ON(!dev_net(dev));
  1185	
  1186		net = dev_net(dev);
  1187	
  1188		/* Allow failover slave to rename even when
  1189		 * it is up and running.
  1190		 *
  1191		 * Failover slaves are special, since userspace
  1192		 * might rename the slave after the interface
  1193		 * has been brought up and running due to
  1194		 * auto-enslavement.
  1195		 *
  1196		 * Failover users don't actually care about slave
  1197		 * name change, as they are only expected to operate
  1198		 * on master interface directly.
  1199		 */
  1200		if (dev->flags & IFF_UP &&
  1201		    likely(!(dev->priv_flags & IFF_FAILOVER_SLAVE)))
  1202			return -EBUSY;
  1203	
  1204		write_seqcount_begin(&devnet_rename_seq);
  1205	
  1206		if (strncmp(newname, dev->name, IFNAMSIZ) == 0) {
  1207			write_seqcount_end(&devnet_rename_seq);
  1208			return 0;
  1209		}
  1210	
  1211		memcpy(oldname, dev->name, IFNAMSIZ);
  1212	
  1213		err = dev_get_valid_name(net, dev, newname);
  1214		if (err < 0) {
  1215			write_seqcount_end(&devnet_rename_seq);
  1216			return err;
  1217		}
  1218	
  1219		if (oldname[0] && !strchr(oldname, '%'))
  1220			netdev_info(dev, "renamed from %s\n", oldname);
  1221	
  1222		old_assign_type = dev->name_assign_type;
  1223		dev->name_assign_type = NET_NAME_RENAMED;
  1224	
  1225	rollback:
  1226		ret = device_rename(&dev->dev, dev->name);
  1227		if (ret) {
  1228			memcpy(dev->name, oldname, IFNAMSIZ);
  1229			dev->name_assign_type = old_assign_type;
  1230			write_seqcount_end(&devnet_rename_seq);
  1231			return ret;
  1232		}
  1233	
  1234		write_seqcount_end(&devnet_rename_seq);
  1235	
  1236		netdev_adjacent_rename_links(dev, oldname);
  1237	
  1238		write_lock_bh(&dev_base_lock);
  1239		hlist_del_rcu(&dev->name_hlist);
  1240		write_unlock_bh(&dev_base_lock);
  1241	
  1242		synchronize_rcu();
  1243	
  1244		write_lock_bh(&dev_base_lock);
  1245		hlist_add_head_rcu(&dev->name_hlist, dev_name_hash(net, dev->name));
  1246		write_unlock_bh(&dev_base_lock);
  1247	
  1248		if (unlikely(dev->flags & IFF_UP)) {
  1249			struct netdev_notifier_change_info change_info;
  1250	
  1251			change_info.flags_changed = 0;
> 1252			call_netdevice_notifiers_info(NETDEV_CHANGE, dev,
  1253						      &change_info.info);
  1254		}
  1255	
  1256		ret = call_netdevice_notifiers(NETDEV_CHANGENAME, dev);
  1257		ret = notifier_to_errno(ret);
  1258	
  1259		if (ret) {
  1260			/* err >= 0 after dev_alloc_name() or stores the first errno */
  1261			if (err >= 0) {
  1262				err = ret;
  1263				write_seqcount_begin(&devnet_rename_seq);
  1264				memcpy(dev->name, oldname, IFNAMSIZ);
  1265				memcpy(oldname, newname, IFNAMSIZ);
  1266				dev->name_assign_type = old_assign_type;
  1267				old_assign_type = NET_NAME_RENAMED;
  1268				goto rollback;
  1269			} else {
  1270				pr_err("%s: name change rollback failed: %d\n",
  1271				       dev->name, ret);
  1272			}
  1273		}
  1274	
  1275		return err;
  1276	}
  1277	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26574 bytes --]

[-- Attachment #3: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2019-03-29 13:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 23:47 [PATCH net v4] failover: allow name change on IFF_UP slave interfaces Si-Wei Liu
2019-03-29  5:55 ` Samudrala, Sridhar
2019-03-29  5:55   ` Samudrala, Sridhar
2019-03-29 19:50   ` si-wei liu
2019-03-29 22:31     ` Michael S. Tsirkin
2019-03-29 22:58       ` si-wei liu
2019-03-29 22:31     ` Michael S. Tsirkin
2019-03-29 13:45 ` kbuild test robot
2019-03-29 13:45 ` kbuild test robot [this message]
2019-03-29 15:15 ` Stephen Hemminger
2019-03-29 15:34   ` Jiri Pirko
2019-03-29 15:34   ` Jiri Pirko
2019-03-29 20:01     ` si-wei liu
2019-03-29 15:15 ` Stephen Hemminger

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='201903292115.lNNVjLgD%lkp__41223.916369357$1553867234$gmane$org@intel.com' \
    --to=lkp@intel.com \
    --cc=alexander.duyck@gmail.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=kbuild-all@01.org \
    --cc=kubakici@wp.pl \
    --cc=liran.alon@oracle.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=si-wei.liu@oracle.com \
    --cc=sridhar.samudrala@intel.com \
    --cc=virtualization@lists.linux-foundation.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.