linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] libquota: fix quota usage compute
@ 2011-11-06 13:40 Niu
  2011-11-14 15:59 ` Ted Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Niu @ 2011-11-06 13:40 UTC (permalink / raw)
  To: adityakali; +Cc: linux-ext4

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

Signed-off-by: Niu Yawei <niu@whamcloud.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3] libquota: fix quota usage compute
  2011-11-06 13:40 [PATCH 3/3] libquota: fix quota usage compute Niu
@ 2011-11-14 15:59 ` Ted Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2011-11-14 15:59 UTC (permalink / raw)
  To: Niu; +Cc: adityakali, linux-ext4

On Sun, Nov 06, 2011 at 09:40:53PM +0800, Niu wrote:
> In quota_compute_usage(), the space usage should be in bytes but
> not quota block.
> 
> Signed-off-by: Niu Yawei <niu@whamcloud.com>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-14 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-06 13:40 [PATCH 3/3] libquota: fix quota usage compute Niu
2011-11-14 15:59 ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).