diff options
Diffstat (limited to 'xlators/cluster/dht/src/dht-selfheal.c')
| -rw-r--r-- | xlators/cluster/dht/src/dht-selfheal.c | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 7fa05a95a53..eadc229fb3b 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -1088,6 +1088,7 @@ dht_selfheal_dir_setattr (call_frame_t *frame, loc_t *loc, struct iatt *stbuf,          int           i     = 0, ret = -1;          dht_local_t  *local = NULL;          xlator_t     *this = NULL; +        int           cnt  = 0;          local = frame->local;          this = frame->this; @@ -1113,7 +1114,8 @@ dht_selfheal_dir_setattr (call_frame_t *frame, loc_t *loc, struct iatt *stbuf,                  gf_uuid_copy (loc->gfid, local->gfid);          local->call_cnt = missing_attr; -        for (i = 0; i < layout->cnt; i++) { +        cnt = layout->cnt; +        for (i = 0; i < cnt; i++) {                  if (layout->list[i].err == -1) {                          gf_msg_trace (this->name, 0,                                        "%s: setattr on subvol %s, gfid = %s", @@ -1237,6 +1239,7 @@ dht_selfheal_dir_mkdir_lookup_done (call_frame_t *frame, xlator_t *this)          dict_t       *dict = NULL;          dht_layout_t  *layout = NULL;          loc_t        *loc   = NULL; +        int           cnt   = 0;          VALIDATE_OR_GOTO (this->private, err); @@ -1269,7 +1272,8 @@ dht_selfheal_dir_mkdir_lookup_done (call_frame_t *frame, xlator_t *this)                          DHT_MSG_DICT_SET_FAILED,                          "dict is NULL, need to make sure gfids are same"); -        for (i = 0; i < layout->cnt; i++) { +        cnt = layout->cnt; +        for (i = 0; i < cnt; i++) {                  if (layout->list[i].err == ESTALE ||                      layout->list[i].err == ENOENT ||                      local->selfheal.force_mkdir) {  | 
