All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: linux-ext4@vger.kernel.org, tytso@mit.edu
Cc: Jan Kara <jack@suse.cz>, Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [PATCH v2] ext4: remove the entry from es tree when bigalloc is enabled
Date: Mon, 29 Jul 2013 23:07:10 +0800	[thread overview]
Message-ID: <20130729150710.GA2615@gmail.com> (raw)
In-Reply-To: <1374795726-28859-1-git-send-email-wenqing.lz@taobao.com>

On Fri, Jul 26, 2013 at 07:42:06AM +0800, Zheng Liu wrote:
> From: Jan Kara <jack@suse.cz>
> 
> Now in ext4_da_page_release_reservation() we remove the entry from es
> tree if to_release != 0.  But there are two issues.  One is that it is
> wrong when blocksize != pagesize, another is that we don't need to do
> this if ->s_cluster_ratio == 1 because we will remove the entry in
> ext4_truncate/ext4_punch_hole.  Here we need to do this just because
> when ->s_cluster_ratio > 1 we will determine whether we can release
> the reserved space according to ext4_find_delalloc_cluster().
> 
> This commit tries to fix these problems.  Now we remove the entry from
> es tree only if ->s_cluster_ratio > 1.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>

Any comment?

Thanks,
                                                - Zheng

> ---
> v2:
>  * fix a typo in comment.
> 
>  fs/ext4/inode.c |   10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index ba33c67..2cc97a4 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -1387,7 +1387,15 @@ static void ext4_da_page_release_reservation(struct page *page,
>  		curr_off = next_off;
>  	} while ((bh = bh->b_this_page) != head);
>  
> -	if (to_release) {
> +	/*
> +	 * Here we need to remove the entry from es tree because when bigalloc
> +	 * is enabled we need to determine whether we can release the reserved
> +	 * space according to the result of ext4_find_delalloc_cluster().
> +	 *
> +	 * If bigalloc is disabled, we don't need to do this here because these
> +	 * entries in es tree will be removed in ext4_truncate/ext4_punch_hole.
> +	 */
> +	if (sbi->s_cluster_ratio > 1 && to_release) {
>  		lblk = page->index << (PAGE_CACHE_SHIFT - inode->i_blkbits);
>  		ext4_es_remove_extent(inode, lblk, to_release);
>  	}
> -- 
> 1.7.9.7
> 

  reply	other threads:[~2013-07-29 15:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 23:42 [PATCH v2] ext4: remove the entry from es tree when bigalloc is enabled Zheng Liu
2013-07-29 15:07 ` Zheng Liu [this message]
2013-07-29 16:21 ` Theodore Ts'o
2013-07-29 17:50   ` Jan Kara
2013-07-29 23:44   ` Zheng Liu
2013-07-30 16:14     ` Jan Kara

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=20130729150710.GA2615@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=wenqing.lz@taobao.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.