]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_quota: don't stop the directory tree walk when DEPTH is hit
authorKazuya Mio <k-mio@sx.jp.nec.com>
Wed, 1 Aug 2018 22:06:44 +0000 (17:06 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 1 Aug 2018 22:06:44 +0000 (17:06 -0500)
To set/check/clear a project quota, xfs_quota performs a pre-order tree
traversal by using nftw(3).  The documentation states that the -d option
can be used to skip subtrees below a certain level in the directory
hierarchy.  Unfortunately, {check,setup,clear}_project returns -1 when
DEPTH is hit, which stops the directory tree walk immediately.  We only
wanted to skip the subtree, so return 0 instead.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
quota/project.c

index 0800ab2a9b46895fee7d525cdf08792a7feac865..78ede9e5cdad94a1d2fb7fd7ce55ff13e2c5a52e 100644 (file)
@@ -89,7 +89,7 @@ check_project(
        int                     fd;
 
        if (recurse_depth >= 0 && data->level > recurse_depth)
-               return -1;
+               return 0;
 
        if (flag == FTW_NS ){
                exitcode = 1;
@@ -134,7 +134,7 @@ clear_project(
        int                     fd;
 
        if (recurse_depth >= 0 && data->level > recurse_depth)
-               return -1;
+               return 0;
 
        if (flag == FTW_NS ){
                exitcode = 1;
@@ -181,7 +181,7 @@ setup_project(
        int                     fd;
 
        if (recurse_depth >= 0 && data->level > recurse_depth)
-               return -1;
+               return 0;
 
        if (flag == FTW_NS ){
                exitcode = 1;