From: Niu Date: Mon, 14 Nov 2011 15:58:28 +0000 (-0500) Subject: libquota: fix quota usage compute X-Git-Tag: v1.42-WIP-1120~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bed9a78828e56ddb687cf2b5f1d6ec1f5e5ecc6;p=thirdparty%2Fe2fsprogs.git 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 Signed-off-by: Theodore Ts'o --- diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c index 2abb2d4e9..832b135e6 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); }