diff options
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 25 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-selfheal.c | 3 |
2 files changed, 24 insertions, 4 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 378377f05ee..80895bd4c9f 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -3593,6 +3593,28 @@ dht_common_setxattr_cbk (call_frame_t *frame, void *cookie, +static int +dht_fix_layout_setxattr_cbk (call_frame_t *frame, void *cookie, + xlator_t *this, int32_t op_ret, int32_t op_errno, + dict_t *xdata) +{ + dht_local_t *local = NULL; + dht_layout_t *layout = NULL; + + if (op_ret == 0) { + + /* update the layout in the inode ctx */ + local = frame->local; + layout = local->selfheal.layout; + + dht_layout_set (this, local->loc.inode, layout); + } + + DHT_STACK_UNWIND (setxattr, frame, op_ret, op_errno, xdata); + return 0; +} + + int dht_err_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, int op_errno, dict_t *xdata) @@ -5604,7 +5626,8 @@ dht_setxattr (call_frame_t *frame, xlator_t *this, DHT_MSG_FIX_LAYOUT_INFO, "fixing the layout of %s", loc->path); - ret = dht_fix_directory_layout (frame, dht_common_setxattr_cbk, + ret = dht_fix_directory_layout (frame, + dht_fix_layout_setxattr_cbk, layout); if (ret) { op_errno = ENOTCONN; diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 4762f25067f..d3163fd1cfc 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -2000,9 +2000,6 @@ dht_fix_layout_of_directory (call_frame_t *frame, loc_t *loc, } done: if (new_layout) { - /* Now that the new layout has all the proper layout, change the - inode context */ - dht_layout_set (this, loc->inode, new_layout); /* Make sure the extra 'ref' for existing layout is removed */ dht_layout_unref (this, local->layout); |