When reading LNet tunables, ni_status can be NULL. This
triggers an LASSERT() rather than gracefully handling it.
Instead, don't crash. Remove the LASSERT().
lnet_ni_get_status_locked() already handles a NULL ni_status.
While it's questionable whether ni_status == NULL should be
LNET_NI_STATUS_UP or LNET_NI_STATUS_DOWN, it definitely
should not crash.
Also, use lnet_ni_get_status() instead of
lnet_ni_get_status_locked().
Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I1d8ba9b5f6478d2a915ac6c7f33c22d1742c43d0
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59482
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Max Wang <wamax@amazon.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
return update;
}
+static inline unsigned int
+lnet_ni_get_status(struct lnet_ni *ni)
+{
+ unsigned int status;
+
+ lnet_ni_lock(ni);
+ status = lnet_ni_get_status_locked(ni);
+ lnet_ni_unlock(ni);
+
+ return status;
+}
+
static inline void lnet_md_wait_handling(struct lnet_libmd *md, int cpt)
{
wait_queue_head_t *wq = __var_waitqueue(md);
if (the_lnet.ln_routing)
last_alive = now - ni->ni_net->net_last_alive;
- lnet_ni_lock(ni);
- LASSERT(ni->ni_status != NULL);
- stat = (lnet_ni_get_status_locked(ni) ==
+ stat = (lnet_ni_get_status(ni) ==
LNET_NI_STATUS_UP) ? "up" : "down";
- lnet_ni_unlock(ni);
/* @lo forever alive */
if (ni->ni_net->net_lnd->lnd_type == LOLND) {