e7a346
From 4ef66d687918c87393b26b8e72d5eb2f5f9e30f0 Mon Sep 17 00:00:00 2001
e7a346
From: Sanoj Unnikrishnan <sunnikri@redhat.com>
e7a346
Date: Mon, 16 Jul 2018 11:16:24 +0530
e7a346
Subject: [PATCH 318/325] Quota: Fix crawling of files
e7a346
e7a346
Problem: Running "find ." does not crawl files. It goes over the
e7a346
directories and lists all dentries with getdents system call.
e7a346
Hence the files are not looked up.
e7a346
e7a346
Solution:
e7a346
explicitly triggerr stat on files with find . -exec stat {} \;
e7a346
since crawl can take slightly longer, updating timeout in test case
e7a346
e7a346
Backport of,
e7a346
> Change-Id: If3c1fba2ed8e300c9cc08c1b5c1ba93cb8e4d6b6
e7a346
> bug: 1533000
e7a346
> patch: https://review.gluster.org/#/c/20057/
e7a346
> Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
e7a346
e7a346
BUG: 1581231
e7a346
Change-Id: I39768e22a7139f77de1740432b9de4a5c870b359
e7a346
Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/144022
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e7a346
---
e7a346
 tests/bugs/quota/bug-1293601.t             | 2 +-
e7a346
 xlators/mgmt/glusterd/src/glusterd-quota.c | 4 +++-
e7a346
 2 files changed, 4 insertions(+), 2 deletions(-)
e7a346
e7a346
diff --git a/tests/bugs/quota/bug-1293601.t b/tests/bugs/quota/bug-1293601.t
e7a346
index 52b03bc..def4ef9 100644
e7a346
--- a/tests/bugs/quota/bug-1293601.t
e7a346
+++ b/tests/bugs/quota/bug-1293601.t
e7a346
@@ -27,6 +27,6 @@ EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/"
e7a346
 TEST $CLI volume quota $V0 disable
e7a346
 TEST $CLI volume quota $V0 enable
e7a346
 
e7a346
-EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/"
e7a346
+EXPECT_WITHIN 40 "1.0MB" quotausage "/"
e7a346
 
e7a346
 cleanup;
e7a346
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c
e7a346
index 1c3a801..6d3918b 100644
e7a346
--- a/xlators/mgmt/glusterd/src/glusterd-quota.c
e7a346
+++ b/xlators/mgmt/glusterd/src/glusterd-quota.c
e7a346
@@ -341,7 +341,9 @@ _glusterd_quota_initiate_fs_crawl (glusterd_conf_t *priv,
e7a346
 
e7a346
                 if (type == GF_QUOTA_OPTION_TYPE_ENABLE ||
e7a346
                     type == GF_QUOTA_OPTION_TYPE_ENABLE_OBJECTS)
e7a346
-                        runner_add_args (&runner, "/usr/bin/find", ".", NULL);
e7a346
+                        runner_add_args (&runner, "/usr/bin/find", ".",
e7a346
+                                         "-exec", "/usr/bin/stat",
e7a346
+                                         "{}", "\\", ";", NULL);
e7a346
 
e7a346
                 else if (type == GF_QUOTA_OPTION_TYPE_DISABLE) {
e7a346
 
e7a346
-- 
e7a346
1.8.3.1
e7a346