aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2021-07-12 17:43:08 +0200
committerTheodore Ts'o <tytso@mit.edu>2021-08-03 11:50:32 -0400
commitdfe01a11a499b2a87d7d64df46e4feaf86f7dcb0 (patch)
tree6e0456f596f1f7c35430b5ed966428a1e6fe8e17
parente20b37fac1fc357f0424a99414fcdb0a628bcff7 (diff)
downloade2fsprogs-dfe01a11a499b2a87d7d64df46e4feaf86f7dcb0.tar.gz
quota: Do not account space used by project quota file to quota
Project quota files have high inode numbers but are not accounted in quota usage. Do not track them when computing quota usage. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--lib/support/mkquota.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c
index 71f42c2cb..dce077e64 100644
--- a/lib/support/mkquota.c
+++ b/lib/support/mkquota.c
@@ -501,9 +501,11 @@ errcode_t quota_compute_usage(quota_ctx_t qctx)
}
if (ino == 0)
break;
- if (inode->i_links_count &&
- (ino == EXT2_ROOT_INO ||
- ino >= EXT2_FIRST_INODE(fs->super))) {
+ if (!inode->i_links_count)
+ continue;
+ if (ino == EXT2_ROOT_INO ||
+ (ino >= EXT2_FIRST_INODE(fs->super) &&
+ ino != quota_type2inum(PRJQUOTA, fs->super))) {
space = ext2fs_get_stat_i_blocks(fs,
EXT2_INODE(inode)) << 9;
quota_data_add(qctx, inode, ino, space);