summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-10-06 18:16:49 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-10-06 21:04:53 -0700
commitff5ea98c6c0ffb7398562b418e8e9c422f08691d (patch)
treef401b4534164fe4ff3db40132d732f1a708eacf2
parentb7d2dba8b655f174f810ba0aa9a4770e5cfaa609 (diff)
quota: use copy_frame when creating new frame during quota_check_limit
DHT re-balance, sets frame root PID < 0 and quota_check_limit skips enforcement if this PID is less than 0. When creating new frame for quota_check_limit we need to use copy_frame instead of create_frame, so that all auth information are copied from original frame. Change-Id: Ib3b4a3744f8b0d72a8bc32826f6edae836d6faed BUG: 1267812 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12265 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
-rw-r--r--tests/bugs/quota/bug-1260545.t3
-rw-r--r--xlators/features/quota/src/quota.c3
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/bugs/quota/bug-1260545.t b/tests/bugs/quota/bug-1260545.t
index 7cd137dda61..b3e9eb42a9c 100644
--- a/tests/bugs/quota/bug-1260545.t
+++ b/tests/bugs/quota/bug-1260545.t
@@ -20,11 +20,12 @@ TEST $CLI volume quota $V0 enable;
TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0;
-TEST $CLI volume quota $V0 limit-usage / 15MB
+TEST $CLI volume quota $V0 limit-usage / 10MB
TEST $CLI volume quota $V0 hard-timeout 0
TEST $CLI volume quota $V0 soft-timeout 0
TEST $QDD $M0/f1 256 40
+TEST ! $QDD $M0/f2 256 40
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quotausage "/"
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 1a8aa87a2f6..03c4a69fe68 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -1371,7 +1371,7 @@ do_quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this,
if (parent == NULL)
goto out;
- new_frame = create_frame (this, this->ctx->pool);
+ new_frame = copy_frame (frame);
if (new_frame == NULL)
goto out;
@@ -1379,7 +1379,6 @@ do_quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this,
if (new_local == NULL)
goto out;
- new_frame->root->uid = new_frame->root->gid = 0;
new_frame->local = new_local;
new_local->par_frame = frame;