lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 12 Feb 2018 15:00:40 +0300
From:   Artem Blagodarenko <artem.blagodarenko@...il.com>
To:     linux-ext4@...r.kernel.org
Cc:     Andrew Perepechko <anserper@...ru>
Subject: [PATCH] e2fsck: properly account cluster size

From: Andrew Perepechko <anserper@...ru>

The patch fixes the quota_data_add() call so that
not num_blocks * block_size is passed, but instead
num_blocks * blocks_per_cluster * block_size.

Otherwise, any trivial test with -O bigalloc,quota
filesystem leads to check errors like

[QUOTA WARNING] Usage inconsistent for ID 0:actual (8192, 2) != expected
(131072, 2)
Update quota info for quota type 0<y>? cancelled!
[QUOTA WARNING] Usage inconsistent for ID 0:actual (8192, 2) != expected
(131072, 2)
Update quota info for quota type 1<y>? cancelled!

Cray-bug-id: LUS-5373

Signed-off-by: Andrew Perepechko <anserper@...ru>
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@...il.com>
---
 e2fsck/pass1.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 5015d938..471162ea 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -3387,6 +3387,8 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
 		}
 	}
 
+	pb.num_blocks *= EXT2FS_CLUSTER_RATIO(fs);
+
 	if (ino != quota_type2inum(PRJQUOTA, fs->super) &&
 	    (ino == EXT2_ROOT_INO || ino >= EXT2_FIRST_INODE(ctx->fs->super)) &&
 	    !(inode->i_flags & EXT4_EA_INODE_FL)) {
-- 
2.14.3 (Apple Git-98)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux - Powered by OpenVZ