linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Tao Ma <tm@tao.ma>
Cc: linux-ext4@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>
Subject: Re: [PATCH] ext4: let getattr report the right blocks in delalloc+bigalloc.
Date: Thu, 31 May 2012 12:08:50 -0500	[thread overview]
Message-ID: <4FC7A5A2.1080704@redhat.com> (raw)
In-Reply-To: <1328025496-3521-1-git-send-email-tm@tao.ma>

On 1/31/12 9:58 AM, Tao Ma wrote:
> From: Tao Ma <boyu.mt@taobao.com>
> 
> In delayed allocation, i_reserved_data_blocks now indicates
> clusters, not blocks. So report it in the right number.
> 
> This can be easily exposed by the following command:
> echo foo > blah; du -hc blah; sync; du -hc blah
> 
> Cc: "Theodore Ts'o" <tytso@mit.edu>
> Reported-by: Eric Sandeen <sandeen@redhat.com>
> Signed-off-by: Tao Ma <boyu.mt@taobao.com>

Reviewed-by: Eric Sandeen <sandeen2redhat.com>

It'd be great to get this one merged.

Thanks,
-Eric

> ---
>  fs/ext4/inode.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index feaa82f..a5eb8c6 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -4200,7 +4200,8 @@ int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
>  	 * will return the blocks that include the delayed allocation
>  	 * blocks for this file.
>  	 */
> -	delalloc_blocks = EXT4_I(inode)->i_reserved_data_blocks;
> +	delalloc_blocks = EXT4_C2B(EXT4_SB(inode->i_sb),
> +				EXT4_I(inode)->i_reserved_data_blocks);
>  
>  	stat->blocks += (delalloc_blocks << inode->i_sb->s_blocksize_bits)>>9;
>  	return 0;


  reply	other threads:[~2012-05-31 18:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 15:58 [PATCH] ext4: let getattr report the right blocks in delalloc+bigalloc Tao Ma
2012-05-31 17:08 ` Eric Sandeen [this message]
2012-06-01  0:43   ` Ted Ts'o
2012-06-01  3:52     ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FC7A5A2.1080704@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tm@tao.ma \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).