From: Liang Zhen Date: Tue, 16 Sep 2014 03:49:40 +0000 (+0800) Subject: LU-5639 lnet: portal spreading rotor should be unsigned X-Git-Tag: 2.6.53~19 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e50fc41ad6383e31b896a9306307f10ced1b3de2;hp=dbe544883a59d7eecaace16400c575b416c51002 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 --- 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);