aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Zhen <liang.zhen@intel.com>2015-02-01 21:52:10 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-07 04:31:10 -0500
commit70c86ace9008f83f3b3b0dd995c60942e1057347 (patch)
tree936533c243dd0c5d0bdad89fb99740465bdc40fe
parentdbab2d8563d8a988dd4ec740ab9c06a4f86890ea (diff)
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 <liang.zhen@intel.com> Reviewed-on: http://review.whamcloud.com/11936 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5639 Reviewed-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lib-types.h2
-rw-r--r--drivers/staging/lustre/lnet/lnet/lib-ptl.c8
2 files changed, 5 insertions, 5 deletions
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 {
622 /* Match table for each CPT */ 622 /* Match table for each CPT */
623 struct lnet_match_table **ptl_mtables; 623 struct lnet_match_table **ptl_mtables;
624 /* spread rotor of incoming "PUT" */ 624 /* spread rotor of incoming "PUT" */
625 int ptl_rotor; 625 unsigned int ptl_rotor;
626 /* # active entries for this portal */ 626 /* # active entries for this portal */
627 int ptl_mt_nmaps; 627 int ptl_mt_nmaps;
628 /* array of active entries' cpu-partition-id */ 628 /* 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)
262{ 262{
263 struct lnet_match_table *mtable; 263 struct lnet_match_table *mtable;
264 struct lnet_portal *ptl; 264 struct lnet_portal *ptl;
265 int nmaps; 265 unsigned int nmaps;
266 int rotor; 266 unsigned int rotor;
267 int routed; 267 unsigned int cpt;
268 int cpt; 268 bool routed;
269 269
270 /* NB: called w/o lock */ 270 /* NB: called w/o lock */
271 LASSERT(info->mi_portal < the_lnet.ln_nportals); 271 LASSERT(info->mi_portal < the_lnet.ln_nportals);