linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: cmm@us.ibm.com, tytso@mit.edu, sandeen@redhat.com
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: Update i_disksize correctly in ext4_get_block
Date: Mon, 9 Jun 2008 15:15:04 +0530	[thread overview]
Message-ID: <20080609094504.GA9518@skywalker> (raw)
In-Reply-To: <1212998970-3618-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

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@linux.vnet.ibm.com>
> ---
>  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

      reply	other threads:[~2008-06-09  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-09  8:09 [PATCH] ext4: Update i_disksize correctly in ext4_get_block Aneesh Kumar K.V
2008-06-09  9:45 ` Aneesh Kumar K.V [this message]

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=20080609094504.GA9518@skywalker \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --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).