[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201903290354.GYaxkjYZ%lkp@intel.com>
Date: Fri, 29 Mar 2019 03:49:56 +0800
From: kbuild test robot <lkp@...el.com>
To: Si-Wei Liu <si-wei.liu@...cle.com>
Cc: kbuild-all@...org, mst@...hat.com, sridhar.samudrala@...el.com,
stephen@...workplumber.org, davem@...emloft.net, kubakici@...pl,
alexander.duyck@...il.com, jiri@...nulli.us,
netdev@...r.kernel.org, virtualization@...ts.linux-foundation.org,
liran.alon@...cle.com, boris.ostrovsky@...cle.com,
vijay.balakrishna@...cle.com, si-wei liu <si-wei.liu@...cle.com>
Subject: Re: [PATCH net v3] failover: allow name change on IFF_UP slave
interfaces
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-020744
config: openrisc-or1ksim_defconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=openrisc
All errors (new ones prefixed by >>):
net/core/dev.c: In function 'dev_change_name':
>> net/core/dev.c:1277:9: error: too few arguments to function 'dev_open'
ret = dev_open(dev);
^~~~~~~~
In file included from net/core/dev.c:93:0:
include/linux/netdevice.h:2636:5: note: declared here
int dev_open(struct net_device *dev, struct netlink_ext_ack *extack);
^~~~~~~~
vim +/dev_open +1277 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 bool reopen_needed = false;
1179 char oldname[IFNAMSIZ];
1180 int err = 0;
1181 int ret;
1182 struct net *net;
1183
1184 ASSERT_RTNL();
1185 BUG_ON(!dev_net(dev));
1186
1187 net = dev_net(dev);
1188
1189 /* Allow failover slave to rename even when
1190 * it is up and running.
1191 *
1192 * Failover slaves are special, since userspace
1193 * might rename the slave after the interface
1194 * has been brought up and running due to
1195 * auto-enslavement.
1196 *
1197 * Failover users don't actually care about slave
1198 * name change, as they are only expected to operate
1199 * on master interface directly.
1200 */
1201 if (dev->flags & IFF_UP) {
1202 if (likely(!(dev->priv_flags & IFF_FAILOVER_SLAVE)))
1203 return -EBUSY;
1204 reopen_needed = true;
1205 }
1206
1207 write_seqcount_begin(&devnet_rename_seq);
1208
1209 if (strncmp(newname, dev->name, IFNAMSIZ) == 0) {
1210 write_seqcount_end(&devnet_rename_seq);
1211 return 0;
1212 }
1213
1214 memcpy(oldname, dev->name, IFNAMSIZ);
1215
1216 err = dev_get_valid_name(net, dev, newname);
1217 if (err < 0) {
1218 write_seqcount_end(&devnet_rename_seq);
1219 return err;
1220 }
1221
1222 if (reopen_needed)
1223 dev_close(dev);
1224
1225 if (oldname[0] && !strchr(oldname, '%'))
1226 netdev_info(dev, "renamed from %s\n", oldname);
1227
1228 old_assign_type = dev->name_assign_type;
1229 dev->name_assign_type = NET_NAME_RENAMED;
1230
1231 rollback:
1232 ret = device_rename(&dev->dev, dev->name);
1233 if (ret) {
1234 memcpy(dev->name, oldname, IFNAMSIZ);
1235 dev->name_assign_type = old_assign_type;
1236 write_seqcount_end(&devnet_rename_seq);
1237 if (err >= 0)
1238 err = ret;
1239 goto reopen;
1240 }
1241
1242 write_seqcount_end(&devnet_rename_seq);
1243
1244 netdev_adjacent_rename_links(dev, oldname);
1245
1246 write_lock_bh(&dev_base_lock);
1247 hlist_del_rcu(&dev->name_hlist);
1248 write_unlock_bh(&dev_base_lock);
1249
1250 synchronize_rcu();
1251
1252 write_lock_bh(&dev_base_lock);
1253 hlist_add_head_rcu(&dev->name_hlist, dev_name_hash(net, dev->name));
1254 write_unlock_bh(&dev_base_lock);
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 reopen:
1276 if (reopen_needed) {
> 1277 ret = dev_open(dev);
1278 if (ret) {
1279 pr_err("%s: reopen device failed: %d\n",
1280 dev->name, ret);
1281 }
1282 }
1283
1284 return err;
1285 }
1286
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Download attachment ".config.gz" of type "application/gzip" (8104 bytes)
Powered by blists - more mailing lists