Commit 30f32e09 authored by Doug Oucahrek's avatar Doug Oucahrek Committed by Greg Kroah-Hartman

staging: lustre: o2iblnd: fix race at kiblnd_connect_peer

[ Upstream commit cf04968e ]

cmid will be destroyed at OFED if kiblnd_cm_callback return error.
if error happen before the end of kiblnd_connect_peer, it will touch
destroyed cmid and fail as
(o2iblnd_cb.c:1315:kiblnd_connect_peer())
            ASSERTION( cmid->device != ((void *)0) ) failed:
Signed-off-by: default avatarAlexander Boyko <alexander.boyko@seagate.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-10015Reviewed-by: default avatarAlexey Lyashkov <c17817@cray.com>
Reviewed-by: default avatarDoug Oucharek <dougso@me.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Signed-off-by: default avatarDoug Oucharek <dougso@me.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 749c6f0e
......@@ -1299,11 +1299,6 @@ kiblnd_connect_peer(struct kib_peer *peer)
goto failed2;
}
LASSERT(cmid->device);
CDEBUG(D_NET, "%s: connection bound to %s:%pI4h:%s\n",
libcfs_nid2str(peer->ibp_nid), dev->ibd_ifname,
&dev->ibd_ifip, cmid->device->name);
return;
failed2:
......@@ -3005,8 +3000,19 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event)
} else {
rc = rdma_resolve_route(
cmid, *kiblnd_tunables.kib_timeout * 1000);
if (!rc)
if (!rc) {
struct kib_net *net = peer->ibp_ni->ni_data;
struct kib_dev *dev = net->ibn_dev;
CDEBUG(D_NET, "%s: connection bound to "\
"%s:%pI4h:%s\n",
libcfs_nid2str(peer->ibp_nid),
dev->ibd_ifname,
&dev->ibd_ifip, cmid->device->name);
return 0;
}
/* Can't initiate route resolution */
CERROR("Can't resolve route for %s: %d\n",
libcfs_nid2str(peer->ibp_nid), rc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment