Re: [PATCH] ext4: Update i_disksize correctly in ext4_get_block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 09, 2008 at 01:39:30PM +0530, Aneesh Kumar K.V wrote:
> With delayed allocation we delay the allocation of blocks
> and request for blocks in multiple chunks. We should not
> update i_disksize to inode.i_size unless we are allocating
> blocks corresponding to the end of file.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
> ---
>  fs/ext4/extents.c |   10 ++++++++--
>  fs/ext4/inode.c   |   10 ++++++++--
>  2 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index dae3b60..a6d7165 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -2698,6 +2698,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
>  	int err = 0, depth, ret;
>  	unsigned long allocated = 0;
>  	struct ext4_allocation_request ar;
> +	loff_t disksize;
> 
>  	__clear_bit(BH_New, &bh_result->b_state);
>  	ext_debug("blocks %u/%lu requested for inode %u\n",
> @@ -2885,8 +2886,13 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
>  		goto out2;
>  	}
> 
> -	if (extend_disksize && inode->i_size > EXT4_I(inode)->i_disksize)
> -		EXT4_I(inode)->i_disksize = inode->i_size;
> +	if (extend_disksize) {
> +		disksize = ((loff_t) newblock + ar.len) << inode->i_blkbits;


s/newblock/iblock

I will send a new patch.



-aneesh
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux