Commit
09c6e2b872 (LU-16836) causes o2iblnd startup routine to crash
when alias ib interface is used:
ifconfig ib0:0 10.1.0.52 up
modprobe lnet
lnetctl lnet configure
lnetctl net add --net o2ib --if ib0:0
Fix the code which attempts to set the NI status on startup to deal
with the case when corresponding net_device is not found gracefully.
Test-Parameters: trivial testlist=sanity-lnet
Fixes:
09c6e2b872 ("LU-16836 lnet: ensure dev notification")
Signed-off-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Change-Id: Iaef9280a10f27ac28b872d9f4bc119c4d459ef40
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52894
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: Shuichi Ihara <sihara@ddn.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
rcu_read_lock();
netdev = dev_get_by_name_rcu(ni->ni_net_ns, net->ibn_dev->ibd_ifname);
- if (((netdev->reg_state == NETREG_UNREGISTERING) ||
- (netdev->operstate != IF_OPER_UP)) ||
- (lnet_get_link_status(netdev) == 0)) {
+ if (netdev &&
+ ((netdev->reg_state == NETREG_UNREGISTERING) ||
+ (netdev->operstate != IF_OPER_UP) ||
+ (lnet_get_link_status(netdev) == 0))) {
kiblnd_set_ni_fatal_on(ibdev->ibd_hdev, 1);
}
rcu_read_unlock();