From a6ec94de9346f2973d013237cc6584ff9aa89974 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Sun, 10 Apr 2011 05:06:04 +0000 Subject: 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 Signed-off-by: Junaid Signed-off-by: Anand Avati BUG: 2604 (Quota: crossing the set limit) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2604 --- xlators/cluster/dht/src/dht-common.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/dht') 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], -- cgit