From 8062ad0799ad4e92882c25f5a7c6e95a06d63c12 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 27 Aug 2012 11:53:41 +0530 Subject: features/marker: if parent inode is NULL, then get it by inode_parent * If parent inode is NULL (nameless lookups which uses gfid for looking up the inode), then try to get it by inode_parent, instead of returning which results in the inode's contribution not being added to the list. * Prevent exceesive logging while adding the inode's contribution to the list if the operation fails. (Check if the inode's gfid is null which indicates that the inode is not yet linked to the inode table and hence addition of its contribution to the list can fail). Change-Id: I5300f00195ae92a5122613898ae3dabddb2d0bfe BUG: 851953 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/3935 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/features/marker/src/marker-quota-helper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'xlators/features/marker/src/marker-quota-helper.c') diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c index 4fb0bb4b357..af5fed13271 100644 --- a/xlators/features/marker/src/marker-quota-helper.c +++ b/xlators/features/marker/src/marker-quota-helper.c @@ -159,8 +159,16 @@ __mq_add_new_contribution_node (xlator_t *this, quota_inode_ctx_t *ctx, loc_t *l int32_t ret = 0; inode_contribution_t *contribution = NULL; - if (!loc->parent) - goto out; + if (!loc->parent) { + if (!uuid_is_null (loc->pargfid)) + loc->parent = inode_find (loc->inode->table, + loc->pargfid); + if (!loc->parent) + loc->parent = inode_parent (loc->inode, loc->pargfid, + loc->name); + if (!loc->parent) + goto out; + } list_for_each_entry (contribution, &ctx->contribution_head, contri_list) { if (loc->parent && -- cgit