]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libquota: fix quota usage compute
authorNiu <niu@whamcloud.com>
Mon, 14 Nov 2011 15:58:28 +0000 (10:58 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Nov 2011 15:58:28 +0000 (10:58 -0500)
In quota_compute_usage(), the space usage should be in bytes but
not quota block.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/quota/mkquota.c

index 2abb2d4e925445bbe0fc35b0e0226bee80485376..832b135e6652b85171ac25f204a128a908a1f1a5 100644 (file)
@@ -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);
                }