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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FC7A5A2.1080704@redhat.com>
Date:	Thu, 31 May 2012 12:08:50 -0500
From:	Eric Sandeen <sandeen@...hat.com>
To:	Tao Ma <tm@....ma>
CC:	linux-ext4@...r.kernel.org, "Theodore Ts'o" <tytso@....edu>
Subject: Re: [PATCH] ext4: let getattr report the right blocks in delalloc+bigalloc.

On 1/31/12 9:58 AM, Tao Ma wrote:
> From: Tao Ma <boyu.mt@...bao.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@....edu>
> Reported-by: Eric Sandeen <sandeen@...hat.com>
> Signed-off-by: Tao Ma <boyu.mt@...bao.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;

--
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