lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 06 Nov 2011 21:40:53 +0800
From:	Niu <niu@...mcloud.com>
To:	adityakali@...gle.com
CC:	linux-ext4@...r.kernel.org
Subject: [PATCH 3/3] libquota: fix quota usage compute

In quota_compute_usage(), the space usage should be in bytes but
not quota block.

Signed-off-by: Niu Yawei <niu@...mcloud.com>
---
 lib/quota/mkquota.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
index 2abb2d4..832b135 100644
--- a/lib/quota/mkquota.c
+++ b/lib/quota/mkquota.c
@@ -402,8 +402,7 @@ errcode_t quota_compute_usage(quota_ctx_t qctx)
 		if (ino == 0)
 			break;
 		if (inode.i_links_count) {
-			/* Convert i_blocks to # of 1k blocks */
-			space = (ext2fs_inode_i_blocks(fs, &inode) + 1) >> 1;
+			space = ext2fs_inode_i_blocks(fs, &inode) << 9;
 			quota_data_add(qctx, &inode, ino, space);
 			quota_data_inodes(qctx, &inode, ino, +1);
 		}
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ