summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-03-05 23:54:51 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-07 09:24:03 -0800
commitac568d561ba15a148d8de6a3d4431714bce230f6 (patch)
treea9f25d89fc6c81b4effd6c9d870dfc39cf6aec2e /xlators/cluster/dht
parentebbc6e802bbffc9c0fd03db1cafefcaaca3a0f05 (diff)
cluster/distribute: send proper 'dict' in readdirp()
if we do the STACK_WIND from readdirp_cbk(), we were not sending the right dictionary which made our linkfile determination a failure. Change-Id: Ie3f26748608f1a81123fe475d8a42bf2717475c3 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 799887 Reviewed-on: http://review.gluster.com/2869 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-common.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index d76abdd5965..2bff9c87b58 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2803,7 +2803,7 @@ done:
STACK_WIND (frame, dht_readdirp_cbk,
next_subvol, next_subvol->fops->readdirp,
local->fd, local->size, next_offset,
- local->xattr_req);
+ local->xattr);
return 0;
}
@@ -2941,21 +2941,29 @@ dht_do_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
dht_deitransform (this, yoff, &xvol, (uint64_t *)&xoff);
- if (dict) {
- ret = dict_set_uint32 (dict, "trusted.glusterfs.dht.linkto",
- 256);
- if (ret)
- gf_log (this->name, GF_LOG_WARNING,
- "failed to set 'glusterfs.dht.linkto' key");
- }
-
/* TODO: do proper readdir */
- if (whichop == GF_FOP_READDIR)
+ if (whichop == GF_FOP_READDIRP) {
+ if (dict)
+ local->xattr = dict_ref (dict);
+ else
+ local->xattr = dict_new ();
+
+ if (local->xattr) {
+ ret = dict_set_uint32 (local->xattr,
+ "trusted.glusterfs.dht.linkto",
+ 256);
+ if (ret)
+ gf_log (this->name, GF_LOG_WARNING,
+ "failed to set 'glusterfs.dht.linkto'"
+ " key");
+ }
+
+ STACK_WIND (frame, dht_readdirp_cbk, xvol, xvol->fops->readdirp,
+ fd, size, xoff, local->xattr);
+ } else {
STACK_WIND (frame, dht_readdir_cbk, xvol, xvol->fops->readdir,
fd, size, xoff);
- else
- STACK_WIND (frame, dht_readdirp_cbk, xvol, xvol->fops->readdirp,
- fd, size, xoff, dict);
+ }
return 0;