cb8e9e
From dbec1f6a22f79b3b7d86401fefc1a2f6fb0dc820 Mon Sep 17 00:00:00 2001
cb8e9e
From: vmallika <vmallika@redhat.com>
cb8e9e
Date: Fri, 10 Jul 2015 16:04:16 +0530
cb8e9e
Subject: [PATCH 231/234] quota/marker: inspect file/dir invoked without having quota xattrs requested
cb8e9e
cb8e9e
In a lookup and build ancestry quota xattrs are
cb8e9e
not requested, it gives wrong assumption that
cb8e9e
quota xattrs are missing and tries to do
cb8e9e
healing process
cb8e9e
cb8e9e
> Change-Id: I7135101ec0edc72a6310dbb304227eaa3b16cb46
cb8e9e
> BUG: 1207735
cb8e9e
> Signed-off-by: vmallika <vmallika@redhat.com>
cb8e9e
cb8e9e
Change-Id: I819e1fd01a85d8dc6238b278662062b3ed9bc280
cb8e9e
BUG: 1224177
cb8e9e
Signed-off-by: vmallika <vmallika@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/52778
cb8e9e
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
cb8e9e
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
cb8e9e
---
cb8e9e
 xlators/features/marker/src/marker.c |   14 +++++++++++---
cb8e9e
 1 files changed, 11 insertions(+), 3 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
cb8e9e
index c7c9fd3..db6943c 100644
cb8e9e
--- a/xlators/features/marker/src/marker.c
cb8e9e
+++ b/xlators/features/marker/src/marker.c
cb8e9e
@@ -2719,6 +2719,10 @@ marker_lookup (call_frame_t *frame, xlator_t *this,
cb8e9e
 
cb8e9e
         priv = this->private;
cb8e9e
 
cb8e9e
+        xattr_req = xattr_req ? dict_ref (xattr_req) : dict_new ();
cb8e9e
+        if (!xattr_req)
cb8e9e
+                goto err;
cb8e9e
+
cb8e9e
         if (priv->feature_enabled == 0)
cb8e9e
                 goto wind;
cb8e9e
 
cb8e9e
@@ -2732,15 +2736,21 @@ marker_lookup (call_frame_t *frame, xlator_t *this,
cb8e9e
         if (ret == -1)
cb8e9e
                 goto err;
cb8e9e
 
cb8e9e
-        if ((priv->feature_enabled & GF_QUOTA) && xattr_req)
cb8e9e
+        if ((priv->feature_enabled & GF_QUOTA))
cb8e9e
                 mq_req_xattr (this, loc, xattr_req, NULL);
cb8e9e
 wind:
cb8e9e
         STACK_WIND (frame, marker_lookup_cbk, FIRST_CHILD(this),
cb8e9e
                     FIRST_CHILD(this)->fops->lookup, loc, xattr_req);
cb8e9e
+
cb8e9e
+        dict_unref (xattr_req);
cb8e9e
+
cb8e9e
         return 0;
cb8e9e
 err:
cb8e9e
         STACK_UNWIND_STRICT (lookup, frame, -1, ENOMEM, NULL, NULL, NULL, NULL);
cb8e9e
 
cb8e9e
+        if (xattr_req)
cb8e9e
+                dict_unref (xattr_req);
cb8e9e
+
cb8e9e
         return 0;
cb8e9e
 }
cb8e9e
 
cb8e9e
@@ -2780,8 +2790,6 @@ marker_build_ancestry_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
cb8e9e
                         continue;
cb8e9e
                 }
cb8e9e
 
cb8e9e
-                mq_xattr_state (this, &loc, entry->dict, entry->d_stat);
cb8e9e
-
cb8e9e
                 inode_unref (parent);
cb8e9e
                 parent = inode_ref (entry->inode);
cb8e9e
                 loc_wipe (&loc;;
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e