All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: yangerkun <yangerkun@huawei.com>
Cc: tytso@mit.edu, jack@suse.cz, linux-ext4@vger.kernel.org,
	yukuai3@huawei.com
Subject: Re: [PATCH 1/2] ext4: avoid recheck extent for EXT4_EX_FORCE_CACHE
Date: Fri, 1 Oct 2021 11:04:50 +0200	[thread overview]
Message-ID: <20211001090450.GA28799@quack2.suse.cz> (raw)
In-Reply-To: <20210904044946.2102404-2-yangerkun@huawei.com>

On Sat 04-09-21 12:49:45, yangerkun wrote:
> Buffer with verified means that it has been checked before. No need
> verify and call set_buffer_verified again.
> 
> Signed-off-by: yangerkun <yangerkun@huawei.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/extents.c | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index cbf37b2cf871..8559e288472f 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -505,13 +505,16 @@ __read_extent_tree_block(const char *function, unsigned int line,
>  		if (err < 0)
>  			goto errout;
>  	}
> -	if (buffer_verified(bh) && !(flags & EXT4_EX_FORCE_CACHE))
> -		return bh;
> -	err = __ext4_ext_check(function, line, inode,
> -			       ext_block_hdr(bh), depth, pblk);
> -	if (err)
> -		goto errout;
> -	set_buffer_verified(bh);
> +	if (buffer_verified(bh)) {
> +		if (!(flags & EXT4_EX_FORCE_CACHE))
> +			return bh;
> +	} else {
> +		err = __ext4_ext_check(function, line, inode,
> +				       ext_block_hdr(bh), depth, pblk);
> +		if (err)
> +			goto errout;
> +		set_buffer_verified(bh);
> +	}
>  	/*
>  	 * If this is a leaf block, cache all of its entries
>  	 */
> -- 
> 2.31.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2021-10-01  9:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04  4:49 [PATCH 0/2] bugfix for read_extent_tree_block yangerkun
2021-09-04  4:49 ` [PATCH 1/2] ext4: avoid recheck extent for EXT4_EX_FORCE_CACHE yangerkun
2021-10-01  9:04   ` Jan Kara [this message]
2021-09-04  4:49 ` [PATCH 2/2] ext4: check magic even the extent block bh is verified yangerkun
2021-10-01  9:18   ` Jan Kara
2021-10-01 14:09     ` Theodore Ts'o
2021-10-14  7:21       ` yangerkun
2021-10-25  1:10         ` yangerkun
2021-10-08  1:38     ` yangerkun
2021-09-24  9:32 ` [PATCH 0/2] bugfix for read_extent_tree_block yangerkun

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=20211001090450.GA28799@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=yangerkun@huawei.com \
    --cc=yukuai3@huawei.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.