summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-04-10 05:06:04 +0000
committerAnand Avati <avati@gluster.com>2011-04-10 23:52:28 -0700
commita6ec94de9346f2973d013237cc6584ff9aa89974 (patch)
treeaead0478b9cb9fbb33a665ca534c42e744bab8a1 /xlators/cluster/dht
parent0a05984fd99577a1ea5bf8d2cdddd08d9a88ba75 (diff)
cluster/distribute: Account for the first lookup sent to check whether the path is a directory while aggregating quota-xattrs.
- The total number of lookups sent for a directory is equal to (no of children + 1). Hence we should not aggregate the xattrs from the first lookup. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2604 (Quota: crossing the set limit) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2604
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-common.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index f8b7664fa8b..c89b809b49f 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -330,8 +330,12 @@ dht_lookup_root_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
local->op_ret = 0;
- if (local->xattr == NULL)
+ if (local->xattr == NULL) {
local->xattr = dict_ref (xattr);
+ } else {
+ dht_aggregate_xattr (local->xattr, xattr);
+ }
+
if (local->inode == NULL)
local->inode = inode_ref (inode);
@@ -393,6 +397,11 @@ dht_do_fresh_lookup_on_root (xlator_t *this, call_frame_t *frame)
local->layout = NULL;
}
+ if (local->xattr != NULL) {
+ dict_unref (local->xattr);
+ local->xattr = NULL;
+ }
+
ret = dict_set_uint32 (local->xattr_req,
"trusted.glusterfs.dht", 4 * 4);
if (ret)
@@ -953,6 +962,11 @@ dht_lookup_directory (call_frame_t *frame, xlator_t *this, loc_t *loc)
goto unwind;
}
+ if (local->xattr != NULL) {
+ dict_unref (local->xattr);
+ local->xattr = NULL;
+ }
+
for (i = 0; i < call_cnt; i++) {
STACK_WIND (frame, dht_lookup_dir_cbk,
conf->subvolumes[i],