From 9eb84e8c7ae04d7c8aa2f686f1e741fb856d9343 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 12 Sep 2013 17:13:02 +0530 Subject: features/marker: check on gfid instead for pargfid while skipping contribution node creation for root Change-Id: I201a6dddab2258ae3f536281bb0fd17040d8c54e BUG: 969461 Signed-off-by: Raghavendra G --- xlators/features/marker/src/marker-quota.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index bcec2969..26ad0fa5 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -1040,8 +1040,10 @@ mq_create_xattr (xlator_t *this, call_frame_t *frame) } if ((local->loc.path && strcmp (local->loc.path, "/") != 0) - || (local->loc.parent && !__is_root_gfid (local->loc.parent->gfid)) - || (!__is_root_gfid (local->loc.pargfid))) { + || (local->loc.inode && !uuid_is_null (local->loc.inode->gfid) && + !__is_root_gfid (local->loc.inode->gfid)) + || (!uuid_is_null (local->loc.gfid) + && !__is_root_gfid (local->loc.gfid))) { contri = mq_add_new_contribution_node (this, ctx, &local->loc); if (contri == NULL) goto err; @@ -1111,11 +1113,11 @@ mq_check_n_set_inode_xattr (call_frame_t *frame, void *cookie, //check contribution xattr if not root if ((local->loc.path && strcmp (local->loc.path, "/") != 0) - || (!uuid_is_null (local->loc.pargfid) - && !__is_root_gfid (local->loc.pargfid)) - || (local->loc.parent - && !uuid_is_null (local->loc.parent->gfid) - && !__is_root_gfid (local->loc.parent->gfid))) { + || (!uuid_is_null (local->loc.gfid) + && !__is_root_gfid (local->loc.gfid)) + || (local->loc.inode + && !uuid_is_null (local->loc.inode->gfid) + && !__is_root_gfid (local->loc.inode->gfid))) { GET_CONTRI_KEY (contri_key, local->loc.parent->gfid, ret); if (ret < 0) goto out; @@ -2044,10 +2046,10 @@ mq_initiate_quota_txn (xlator_t *this, loc_t *loc) contribution = mq_get_contribution_node (loc->parent, ctx); if (!contribution) { if ((loc->path && strcmp (loc->path, "/")) - || (!uuid_is_null (loc->pargfid) - && !__is_root_gfid (loc->pargfid)) - || (loc->parent && !uuid_is_null (loc->parent->gfid) - && !__is_root_gfid (loc->parent->gfid))) + || (!uuid_is_null (loc->gfid) + && !__is_root_gfid (loc->gfid)) + || (loc->inode && !uuid_is_null (loc->inode->gfid) + && !__is_root_gfid (loc->inode->gfid))) gf_log_callingfn (this->name, GF_LOG_TRACE, "contribution node for the " "path (%s) with parent (%s) " @@ -2139,9 +2141,9 @@ mq_inspect_directory_xattr (xlator_t *this, goto out; if ((loc->path && strcmp (loc->path, "/") != 0) - || (!uuid_is_null (loc->pargfid) && !__is_root_gfid (loc->pargfid)) - || (loc->parent && !uuid_is_null (loc->parent->gfid) && - !__is_root_gfid (loc->parent->gfid))) { + || (!uuid_is_null (loc->gfid) && !__is_root_gfid (loc->gfid)) + || (loc->inode && !uuid_is_null (loc->inode->gfid) && + !__is_root_gfid (loc->inode->gfid))) { not_root = _gf_true; GET_CONTRI_KEY (contri_key, contribution->gfid, ret); -- cgit