summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2013-09-09 03:08:08 -0700
committerAnand Avati <avati@redhat.com>2013-09-09 21:41:41 -0700
commit1f7469164a8d8fb0e031078073465b59c4334752 (patch)
treed9f2786d49f868e8dc8111da2b4ee00752d8453a
parentebcf1c8ddb76ca1234282e5189f6800d89db4b98 (diff)
glusterfsd: use-readdirp w/o arguments should not turn off readdirp
`use-readdirp` has an optional argument in argp - specifying just `--use-readdirp` command line should not 'turn off' readdirp, since that undermines the meaning of such an argument. Change-Id: I965d87e29bd0d61997d9be96fa698e270a2ee173 BUG: 983477 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/5851 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--glusterfsd/src/glusterfsd.c2
-rwxr-xr-xtests/bugs/bug-983477.t7
2 files changed, 8 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index e8ebdae1498..908345d266d 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -1020,7 +1020,7 @@ parse_opts (int key, char *arg, struct argp_state *state)
case ARGP_FUSE_USE_READDIRP_KEY:
if (!arg)
- arg = "no";
+ arg = "yes";
if (gf_string2boolean (arg, &b) == 0) {
if (b) {
diff --git a/tests/bugs/bug-983477.t b/tests/bugs/bug-983477.t
index 6384209e1f8..c19fa96c8bf 100755
--- a/tests/bugs/bug-983477.t
+++ b/tests/bugs/bug-983477.t
@@ -32,6 +32,13 @@ EXPECT_WITHIN 20 "0" get_use_readdirp_value $V0
TEST cd -
TEST umount $M0
+#Since args are optional on this argument just specifying "--use-readdirp" should also turn it `on` not `off`
+TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 --use-readdirp
+TEST cd $M0
+EXPECT_WITHIN 20 "1" get_use_readdirp_value $V0
+TEST cd -
+TEST umount $M0
+
#By default it is enabled.
TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0
TEST cd $M0