From: Liang Zhen Date: Mon, 27 Apr 2015 02:49:41 +0000 (+0800) Subject: LU-6480 o2iblnd: leak cmid in kiblnd_dev_need_failover X-Git-Tag: 2.7.59~30 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;ds=inline;h=6646307454ff710bcff5df71de398e60b00f494e;p=fs%2Flustre-release.git LU-6480 o2iblnd: leak cmid in kiblnd_dev_need_failover cmid created by kiblnd_dev_need_failover should always be destroyed, however it is not the case in current implementation and we will leak cmid when this function detected a device failover. Signed-off-by: Liang Zhen Change-Id: Icc567593f50fd557d5a7d1642a65d4fe49e8b4c2 Reviewed-on: http://review.whamcloud.com/14603 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Isaac Huang Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 32c455b..c02b733 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -2577,13 +2577,9 @@ kiblnd_dev_need_failover(kib_dev_t *dev) return rc; } - if (dev->ibd_hdev->ibh_ibdev == cmid->device) { - /* don't need device failover */ - rdma_destroy_id(cmid); - return 0; - } - - return 1; + rc = dev->ibd_hdev->ibh_ibdev != cmid->device; /* true for failover */ + rdma_destroy_id(cmid); + return rc; } int