From: Kazuya Mio Date: Wed, 1 Aug 2018 22:06:44 +0000 (-0500) Subject: xfs_quota: don't stop the directory tree walk when DEPTH is hit X-Git-Tag: v4.18.0-rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1472d00f03fad554616321436d1a9c4bdaff9714;p=thirdparty%2Fxfsprogs-dev.git xfs_quota: don't stop the directory tree walk when DEPTH is hit 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 Reviewed-by: Carlos Maiolino Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/quota/project.c b/quota/project.c index 0800ab2a9..78ede9e5c 100644 --- a/quota/project.c +++ b/quota/project.c @@ -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;