From e50fc41ad6383e31b896a9306307f10ced1b3de2 Mon Sep 17 00:00:00 2001 From: Liang Zhen Date: Tue, 16 Sep 2014 11:49:40 +0800 Subject: [PATCH] LU-5639 lnet: portal spreading rotor should be unsigned Portal spreading rotor should be unsigned, otherwise lnet may get negative CPT number and access invalid addresses. Signed-off-by: Liang Zhen Change-Id: Id7f40da241af3b01483fdedd366b09329f530163 Reviewed-on: http://review.whamcloud.com/11936 Reviewed-by: Amir Shehata Tested-by: Maloo Tested-by: Jenkins Reviewed-by: Isaac Huang Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- lnet/include/lnet/lib-types.h | 2 +- lnet/lnet/lib-ptl.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index 3a1b667..a6e92bf 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -694,7 +694,7 @@ typedef struct lnet_portal { /* Match table for each CPT */ struct lnet_match_table **ptl_mtables; /* spread rotor of incoming "PUT" */ - int ptl_rotor; + unsigned int ptl_rotor; /* # active entries for this portal */ int ptl_mt_nmaps; /* array of active entries' cpu-partition-id */ diff --git a/lnet/lnet/lib-ptl.c b/lnet/lnet/lib-ptl.c index 621a27a..d6c7dd7 100644 --- a/lnet/lnet/lib-ptl.c +++ b/lnet/lnet/lib-ptl.c @@ -264,10 +264,10 @@ lnet_mt_of_match(struct lnet_match_info *info, struct lnet_msg *msg) { struct lnet_match_table *mtable; struct lnet_portal *ptl; - int nmaps; - int rotor; - int routed; - int cpt; + unsigned int nmaps; + unsigned int rotor; + unsigned int cpt; + bool routed; /* NB: called w/o lock */ LASSERT(info->mi_portal < the_lnet.ln_nportals); -- 1.8.3.1