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

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