Hello Sage Weil, Commit 41ebcc0907c5 ("crush: remove forcefeed functionality") from May 7, 2012 (linux-next), leads to the following Smatch static checker warning: net/ceph/crush/mapper.c:1012 crush_do_rule() warn: iterator 'j' not incremented net/ceph/crush/mapper.c 1004 for (i = 0; i < wsize; i++) { 1005 int bno; 1006 numrep = curstep->arg1; 1007 if (numrep <= 0) { 1008 numrep += result_max; 1009 if (numrep <= 0) 1010 continue; 1011 } --> 1012 j = 0; ^^^^^^ The 2012 commit removed the j++ so now j is always 0. 1013 /* make sure bucket id is valid */ 1014 bno = -1 - w[i]; 1015 if (bno < 0 || bno >= map->max_buckets) { 1016 /* w[i] is probably CRUSH_ITEM_NONE */ 1017 dprintk(" bad w[i] %d\n", w[i]); 1018 continue; 1019 } 1020 if (firstn) { 1021 int recurse_tries; 1022 if (choose_leaf_tries) 1023 recurse_tries = 1024 choose_leaf_tries; 1025 else if (map->chooseleaf_descend_once) 1026 recurse_tries = 1; 1027 else 1028 recurse_tries = choose_tries; 1029 osize += crush_choose_firstn( 1030 map, 1031 cw, 1032 map->buckets[bno], 1033 weight, weight_max, 1034 x, numrep, 1035 curstep->arg2, 1036 o+osize, j, 1037 result_max-osize, 1038 choose_tries, 1039 recurse_tries, 1040 choose_local_retries, 1041 choose_local_fallback_retries, 1042 recurse_to_leaf, 1043 vary_r, 1044 stable, 1045 c+osize, 1046 0, 1047 choose_args); 1048 } else { 1049 out_size = ((numrep < (result_max-osize)) ? 1050 numrep : (result_max-osize)); 1051 crush_choose_indep( 1052 map, 1053 cw, 1054 map->buckets[bno], 1055 weight, weight_max, 1056 x, out_size, numrep, 1057 curstep->arg2, 1058 o+osize, j, 1059 choose_tries, 1060 choose_leaf_tries ? 1061 choose_leaf_tries : 1, 1062 recurse_to_leaf, 1063 c+osize, 1064 0, 1065 choose_args); 1066 osize += out_size; 1067 } 1068 } 1069 1070 if (recurse_to_leaf) 1071 /* copy final _leaf_ values to output set */ 1072 memcpy(o, c, osize*sizeof(*o)); 1073 1074 /* swap o and w arrays */ 1075 swap(o, w); 1076 wsize = osize; 1077 break; 1078 1079 1080 case CRUSH_RULE_EMIT: 1081 for (i = 0; i < wsize && result_len < result_max; i++) { 1082 result[result_len] = w[i]; 1083 result_len++; 1084 } 1085 wsize = 0; 1086 break; 1087 1088 default: 1089 dprintk(" unknown op %d at step %d\n", 1090 curstep->op, step); 1091 break; 1092 } 1093 } 1094 1095 return result_len; 1096 } regards, dan carpenter