summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2012-08-27 11:53:41 +0530
committerVijay Bellur <vbellur@redhat.com>2012-12-12 00:19:02 -0500
commit42394c85c91fae109778f55503c94b729242b52e (patch)
treefd444088a19f871428c8ee6025b92059d4682101
parent06578e0fd605043925d161d24f5201a4b3c11718 (diff)
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). BUG: 851953 Change-Id: I4539b0534894e9d9cf5036c12fbf591ecad586bb Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: https://code.engineering.redhat.com/gerrit/35 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: https://code.engineering.redhat.com/gerrit/138
-rw-r--r--xlators/features/marker/src/marker-quota-helper.c12
-rw-r--r--xlators/features/marker/src/marker-quota.c5
2 files changed, 13 insertions, 4 deletions
diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c
index 8d4ff77..28500f3 100644
--- a/xlators/features/marker/src/marker-quota-helper.c
+++ b/xlators/features/marker/src/marker-quota-helper.c
@@ -168,8 +168,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 &&
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index 621b401..895d131 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -2043,8 +2043,9 @@ mq_inspect_directory_xattr (xlator_t *this,
if (strcmp (loc->path, "/") != 0) {
contribution = mq_add_new_contribution_node (this, ctx, loc);
if (contribution == NULL) {
- gf_log (this->name, GF_LOG_WARNING,
- "cannot add a new contribution node");
+ if (!uuid_is_null (loc->inode->gfid))
+ gf_log (this->name, GF_LOG_WARNING,
+ "cannot add a new contribution node");
ret = -1;
goto err;
}