summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanoj Unnikrishnan <sunnikri@redhat.com>2018-05-22 14:43:12 +0530
committerAmar Tumballi <amarts@redhat.com>2018-07-13 07:34:48 +0000
commitd2fb898e9d0ce4c18e189f598416eaa58ab68d5b (patch)
tree76f6805b71bd368cb46b7b19e1c361809613017d
parent271510b09d0613887f983b1e3dad5c55cdc6cd07 (diff)
Quota: Fix crawling of files
Problem: Running "find ." does not crawl files. It goes over the directories and lists all dentries with getdents system call. Hence the files are not looked up. Solution: explicitly triggerr stat on files with find . -exec stat {} \; since crawl can take slightly longer, updating timeout in test case Change-Id: If3c1fba2ed8e300c9cc08c1b5c1ba93cb8e4d6b6 fixes: bz#1533000 Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
-rw-r--r--tests/bugs/quota/bug-1293601.t2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-quota.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/bugs/quota/bug-1293601.t b/tests/bugs/quota/bug-1293601.t
index 52b03bcc059..def4ef9eda3 100644
--- a/tests/bugs/quota/bug-1293601.t
+++ b/tests/bugs/quota/bug-1293601.t
@@ -27,6 +27,6 @@ EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/"
TEST $CLI volume quota $V0 disable
TEST $CLI volume quota $V0 enable
-EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/"
+EXPECT_WITHIN 40 "1.0MB" quotausage "/"
cleanup;
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c
index 847c1a721d0..ed135d41f64 100644
--- a/xlators/mgmt/glusterd/src/glusterd-quota.c
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.c
@@ -351,7 +351,9 @@ _glusterd_quota_initiate_fs_crawl (glusterd_conf_t *priv,
if (type == GF_QUOTA_OPTION_TYPE_ENABLE ||
type == GF_QUOTA_OPTION_TYPE_ENABLE_OBJECTS)
- runner_add_args (&runner, "find", ".", NULL);
+ runner_add_args (&runner, "/usr/bin/find", ".",
+ "-exec", "/usr/bin/stat",
+ "{}", "\\", ";", NULL);
else if (type == GF_QUOTA_OPTION_TYPE_DISABLE) {