summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2014-06-22 15:20:19 +0530
committerNiels de Vos <ndevos@redhat.com>2014-06-27 01:46:29 -0700
commitbf7c6105f643683e76e5659f028e6a08dabb019c (patch)
tree868c472b9f9e7e87380de71d918923db6f02cb40
parentefb5af6c1a66fc6d8bebb1c96e8b39d6fa6f8dcd (diff)
cluster/stripe: Fix EINVAL errors on quota enabled volumes
Backport of http://review.gluster.org/8145 Write operations on directories with quota enabled used to fail with EINVAL on stripe volumes. This was due to assert failure in stripe_lookup(), meant to ensure loc->path is not NULL. However, in nameless lookup (in this particular case triggered by quotad, which has stripe xlator in its graph), loc->path can be legitimately NULL. The fix involves removing this check in stripe_lookup(). Change-Id: Ibbd4f68763fdd8a85f29da78b3937cef1ee4fd1e BUG: 1100050 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/8186 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
-rw-r--r--tests/bugs/bug-1100050.t25
-rw-r--r--tests/include.rc1
-rw-r--r--tests/volume.rc4
-rw-r--r--xlators/cluster/stripe/src/stripe.c1
4 files changed, 30 insertions, 1 deletions
diff --git a/tests/bugs/bug-1100050.t b/tests/bugs/bug-1100050.t
new file mode 100644
index 00000000000..537591dcd82
--- /dev/null
+++ b/tests/bugs/bug-1100050.t
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+
+TEST glusterd;
+TEST pidof glusterd;
+
+TEST gluster volume create $V0 stripe 2 $H0:$B0/{1,2} force;
+TEST gluster volume start $V0;
+TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0;
+
+TEST gluster volume quota $V0 enable;
+
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" quotad_up_status;
+
+TEST mkdir $M0/dir;
+
+TEST gluster volume quota $V0 limit-usage /dir 10MB;
+
+TEST mkdir $M0/dir/subdir;
+
+cleanup;
diff --git a/tests/include.rc b/tests/include.rc
index 3017de9e653..41c4f332982 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -10,6 +10,7 @@ statedumpdir=`gluster --print-statedumpdir`; # Default directory for statedump
CHILD_UP_TIMEOUT=60
CLI="gluster --mode=script";
+PROCESS_UP_TIMEOUT=20
mkdir -p $B0;
mkdir -p $M0 $M1;
mkdir -p $N0 $N1;
diff --git a/tests/volume.rc b/tests/volume.rc
index 2ddb7fc502d..e3346bc8004 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -146,6 +146,10 @@ function glustershd_up_status {
gluster volume status | grep "Self-heal Daemon" | awk '{print $6}'
}
+function quotad_up_status {
+ gluster volume status | grep "Quota Daemon" | awk '{print $6}'
+}
+
function get_brick_pid {
local vol=$1
local host=$2
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 414f9884ee4..e9374ebbe87 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -298,7 +298,6 @@ stripe_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc,
VALIDATE_OR_GOTO (frame, err);
VALIDATE_OR_GOTO (this, err);
VALIDATE_OR_GOTO (loc, err);
- VALIDATE_OR_GOTO (loc->path, err);
VALIDATE_OR_GOTO (loc->inode, err);
priv = this->private;