diff options
| -rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 6 | ||||
| -rw-r--r-- | xlators/cluster/dht/src/dht-selfheal.c | 18 | 
2 files changed, 24 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 5886886e830..f5fd0bd7858 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -198,6 +198,7 @@ dht_lookup_selfheal_cbk (call_frame_t *frame, void *cookie,                  ret = dht_layout_set (this, local->inode, layout);          } +        dht_inode_ctx_time_update (local->inode, this, &local->stbuf, 1);          if (local->loc.parent) {                  dht_inode_ctx_time_update (local->loc.parent, this,                                             &local->postparent, 1); @@ -705,6 +706,8 @@ unlock:                          dht_layout_set (this, local->inode, layout);                  } +                dht_inode_ctx_time_update (local->inode, this, +                                           &local->stbuf, 1);                  if (local->loc.parent) {                          dht_inode_ctx_time_update (local->loc.parent, this,                                                     &local->postparent, 1); @@ -6487,6 +6490,9 @@ dht_mkdir_selfheal_cbk (call_frame_t *frame, void *cookie,          if (op_ret == 0) {                  dht_layout_set (this, local->inode, layout); + +                dht_inode_ctx_time_update (local->inode, this, +                                           &local->stbuf, 1);                  if (local->loc.parent) {                          dht_inode_ctx_time_update (local->loc.parent, this,                                                     &local->preparent, 0); diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 1eef4bdb59e..bcc865cca17 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -609,7 +609,9 @@ dht_selfheal_dir_xattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          dht_local_t  *local = NULL;          call_frame_t *prev = NULL;          xlator_t     *subvol = NULL; +        struct iatt  *stbuf = NULL;          int           i = 0; +        int           ret = 0;          dht_layout_t *layout = NULL;          int           err = 0;          int           this_call_cnt = 0; @@ -624,6 +626,12 @@ dht_selfheal_dir_xattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,          else                  err = op_errno; +        ret = dict_get_bin (xdata, DHT_IATT_IN_XDATA_KEY, (void **) &stbuf); +        if (ret < 0) { +                gf_msg_debug (this->name, 0, "key = %s not present in dict", +                              DHT_IATT_IN_XDATA_KEY); +        } +          for (i = 0; i < layout->cnt; i++) {                  if (layout->list[i].xlator == subvol) {                          layout->list[i].err = err; @@ -631,6 +639,7 @@ dht_selfheal_dir_xattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                  }          } +        dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);          this_call_cnt = dht_frame_return (frame);          if (is_last_call (this_call_cnt)) { @@ -690,6 +699,15 @@ dht_selfheal_dir_xattr_persubvol (call_frame_t *frame, loc_t *loc,                  goto err;          } +        ret = dict_set_dynstr_with_alloc (xdata, DHT_IATT_IN_XDATA_KEY, "yes"); +        if (ret < 0) { +                gf_msg (this->name, GF_LOG_WARNING, 0, DHT_MSG_DICT_SET_FAILED, +                        "%s: Failed to set dictionary value: key = %s," +                        " gfid = %s", loc->path, +                        DHT_IATT_IN_XDATA_KEY, gfid); +                goto err; +        } +          gf_uuid_unparse(loc->inode->gfid, gfid);          ret = dht_disk_layout_extract (this, layout, i, &disk_layout);  | 
