staging/lustre/lnet: portal spreading rotor should be unsigned
authorLiang Zhen <liang.zhen@intel.com>
Mon, 2 Feb 2015 02:52:10 +0000 (21:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Feb 2015 09:31:10 +0000 (17:31 +0800)
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>
drivers/staging/lustre/include/linux/lnet/lib-types.h
drivers/staging/lustre/lnet/lnet/lib-ptl.c

index ba1876f57d122997bfaee32cacc351a8823a185f..50537668f59db69f6b25c16dda265ce85442e453 100644 (file)
@@ -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 */
index 19ed696344fefedbd0b5f7084174be05e98d64a8..3ba0da919b418827a3a0b66dae71f0098b3c78ec 100644 (file)
@@ -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);