Whamcloud - gitweb
LU-7734 lnet: fix lnet_peer_table_cleanup_locked()
authorOlaf Weber <olaf@sgi.com>
Thu, 16 Jun 2016 10:27:46 +0000 (12:27 +0200)
committerAmir Shehata <amir.shehata@intel.com>
Wed, 25 Jan 2017 03:10:16 +0000 (19:10 -0800)
commitbaf1a98867ab800f022b12aa5e26a8b7113f9291
tree4bf6c0def60b9071bbda5467060923f34c9f707a
parent63c3e512987308e45005800a7e080ce2a55b1301
LU-7734 lnet: fix lnet_peer_table_cleanup_locked()

In lnet_peer_table_cleanup_locked() we delete the entire peer if the
lnet_peer_ni for the primary NID of the peer is deleted. If the next
lnet_peer_ni in the list belongs to the peer being deleted, then the
next pointer kept by list_for_each_entry_safe() ends up pointing at
freed memory.

Add a list_for_each_entry_from() loop to advance next to a peer_ni
that does not belong to the peer being deleted and will therefore
remain present in the list.

Signed-off-by: Olaf Weber <olaf@sgi.com>
Change-Id: I92bf219dc93a79f7d90035ccfbb38cd251138c04
Reviewed-on: http://review.whamcloud.com/20824
Tested-by: Jenkins
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Tested-by: Amir Shehata <amir.shehata@intel.com>
lnet/lnet/peer.c