Whamcloud - gitweb
LU-5639 lnet: portal spreading rotor should be unsigned 36/11936/3
authorLiang Zhen <liang.zhen@intel.com>
Tue, 16 Sep 2014 03:49:40 +0000 (11:49 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 24 Sep 2014 03:23:47 +0000 (03:23 +0000)
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>
Change-Id: Id7f40da241af3b01483fdedd366b09329f530163
Reviewed-on: http://review.whamcloud.com/11936
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Tested-by: Jenkins
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/include/lnet/lib-types.h
lnet/lnet/lib-ptl.c

index 3a1b667..a6e92bf 100644 (file)
@@ -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 */
index 621a27a..d6c7dd7 100644 (file)
@@ -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);