summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-05-12 15:06:59 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-05-23 23:08:01 -0700
commiteb2001232249d30bf6d4a89e1454615dad7916a6 (patch)
tree6b5cc581c1aa9ed1b63eb5845c8653925a499f17 /xlators/cluster/dht/src
parent1d52eae8532e027a97dd947b3889b38abe0c113c (diff)
features/shard: Get hard-link-count in {unlink,rename}_cbk before deleting shards
Backport of http://review.gluster.org/#/c/14334/ Change-Id: I41321d8b00a10f1bd5b0a7b008f673b1aa240d0c BUG: 1337837 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/14450 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src')
-rw-r--r--xlators/cluster/dht/src/dht-rename.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
index 82a97bc0457..4ed659b588e 100644
--- a/xlators/cluster/dht/src/dht-rename.c
+++ b/xlators/cluster/dht/src/dht-rename.c
@@ -565,7 +565,7 @@ dht_rename_unlock_cbk (call_frame_t *frame, void *cookie,
DHT_STACK_UNWIND (rename, frame, local->op_ret, local->op_errno,
&local->stbuf, &local->preoldparent,
&local->postoldparent, &local->preparent,
- &local->postparent, NULL);
+ &local->postparent, local->xattr);
return 0;
}
@@ -876,6 +876,12 @@ dht_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
uuid_utoa(local->loc.inode->gfid):"");
}
}
+ if (xdata) {
+ if (!local->xattr)
+ local->xattr = dict_ref (xdata);
+ else
+ local->xattr = dict_copy_with_ref (xdata, local->xattr);
+ }
if ((src_cached == dst_cached) && (dst_hashed != dst_cached)) {
link_frame = copy_frame (frame);
@@ -1026,7 +1032,6 @@ dht_do_rename (call_frame_t *frame)
xlator_t *dst_cached = NULL;
xlator_t *this = NULL;
xlator_t *rename_subvol = NULL;
- dict_t *dict = NULL;
local = frame->local;
this = frame->this;
@@ -1041,11 +1046,12 @@ dht_do_rename (call_frame_t *frame)
rename_subvol = dst_hashed;
if ((src_cached != dst_hashed) && (rename_subvol == dst_hashed)) {
- DHT_MARKER_DONT_ACCOUNT(dict);
+ DHT_MARKER_DONT_ACCOUNT(local->xattr_req);
}
if (rename_subvol == src_cached) {
- DHT_CHANGELOG_TRACK_AS_RENAME(dict, &local->loc, &local->loc2);
+ DHT_CHANGELOG_TRACK_AS_RENAME(local->xattr_req, &local->loc,
+ &local->loc2);
}
gf_msg_trace (this->name, 0,
@@ -1056,10 +1062,7 @@ dht_do_rename (call_frame_t *frame)
FRAME_SU_DO (frame, dht_local_t);
STACK_WIND (frame, dht_rename_cbk,
rename_subvol, rename_subvol->fops->rename,
- &local->loc, &local->loc2, dict);
- if (dict)
- dict_unref (dict);
-
+ &local->loc, &local->loc2, local->xattr_req);
return 0;
}
@@ -1554,6 +1557,8 @@ dht_rename (call_frame_t *frame, xlator_t *this,
local->src_cached = src_cached;
local->dst_hashed = dst_hashed;
local->dst_cached = dst_cached;
+ if (xdata)
+ local->xattr_req = dict_ref (xdata);
gf_msg (this->name, GF_LOG_INFO, 0,
DHT_MSG_RENAME_INFO,