Blame SOURCES/e2fsprogs-1.45.6-quota-Do-not-account-space-used-by-project-quota-fil.patch

f239de
From 7c9b477d25a81ef736a832d66793a75860394d6f Mon Sep 17 00:00:00 2001
f239de
From: Jan Kara <jack@suse.cz>
f239de
Date: Mon, 12 Jul 2021 17:43:08 +0200
f239de
Subject: [PATCH 39/46] quota: Do not account space used by project quota file
f239de
 to quota
f239de
Content-Type: text/plain
f239de
f239de
Project quota files have high inode numbers but are not accounted in
f239de
quota usage. Do not track them when computing quota usage.
f239de
f239de
Signed-off-by: Jan Kara <jack@suse.cz>
f239de
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
f239de
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
f239de
---
f239de
 lib/support/mkquota.c | 8 +++++---
f239de
 1 file changed, 5 insertions(+), 3 deletions(-)
f239de
f239de
diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c
f239de
index 6f7ae6d6..ef50c9ab 100644
f239de
--- a/lib/support/mkquota.c
f239de
+++ b/lib/support/mkquota.c
f239de
@@ -500,9 +500,11 @@ errcode_t quota_compute_usage(quota_ctx_t qctx)
f239de
 		}
f239de
 		if (ino == 0)
f239de
 			break;
f239de
-		if (inode->i_links_count &&
f239de
-		    (ino == EXT2_ROOT_INO ||
f239de
-		     ino >= EXT2_FIRST_INODE(fs->super))) {
f239de
+		if (!inode->i_links_count)
f239de
+			continue;
f239de
+		if (ino == EXT2_ROOT_INO ||
f239de
+		    (ino >= EXT2_FIRST_INODE(fs->super) &&
f239de
+		     ino != quota_type2inum(PRJQUOTA, fs->super))) {
f239de
 			space = ext2fs_get_stat_i_blocks(fs,
f239de
 						EXT2_INODE(inode)) << 9;
f239de
 			quota_data_add(qctx, inode, ino, space);
f239de
-- 
f239de
2.35.1
f239de