Whamcloud - gitweb
DDN-92 lnet: portal spreading rotor should be unsigned 36/11936/1
authorLiang Zhen <liang.zhen@intel.com>
Tue, 16 Sep 2014 03:49:40 +0000 (11:49 +0800)
committerLiang Zhen <liang.zhen@intel.com>
Tue, 16 Sep 2014 03:49:40 +0000 (11:49 +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>
Change-Id: Id7f40da241af3b01483fdedd366b09329f530163

lnet/include/lnet/lib-types.h
lnet/lnet/lib-ptl.c

index 9039e7a..1ee59d0 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);