From: Liang Zhen Date: Mon, 2 Feb 2015 02:52:10 +0000 (-0500) Subject: staging/lustre/lnet: portal spreading rotor should be unsigned X-Git-Tag: firefly_0821_release~176^2~2320^2~19 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=70c86ace9008f83f3b3b0dd995c60942e1057347;p=firefly-linux-kernel-4.4.55.git staging/lustre/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 Reviewed-on: http://review.whamcloud.com/11936 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5639 Reviewed-by: Amir Shehata Reviewed-by: Isaac Huang Reviewed-by: Doug Oucharek Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index ba1876f57d12..50537668f59d 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -622,7 +622,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/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c index 19ed696344fe..3ba0da919b41 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c +++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c @@ -262,10 +262,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);