All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/3] btrfs-progs: check: lowmem: Refactor extent len test in check_file_extent_inline
Date: Fri, 14 Sep 2018 07:07:35 +0800	[thread overview]
Message-ID: <c273f6d5-6692-b834-552d-ff47fab70943@gmx.com> (raw)
In-Reply-To: <20180913120507.18197-3-nborisov@suse.com>



On 2018/9/13 下午8:05, Nikolay Borisov wrote:
> Instead of having another top-level if which checks for
> 'extent_num_bytes != item_inline_len' only if we are !compressed, just
> move the 'if' inside the 'else' branch of the first top-level if, since
> it has already checked for !compressed or not. No functional changes.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>  check/mode-lowmem.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c
> index 48c1537e7440..3a6fbb33c858 100644
> --- a/check/mode-lowmem.c
> +++ b/check/mode-lowmem.c
> @@ -1860,19 +1860,20 @@ static int check_file_extent_inline(struct btrfs_root *root,
>  				err |= FILE_EXTENT_ERROR;
>  		}
>  
> -	}
> -	if (!compressed && extent_num_bytes != item_inline_len) {
> -		error(
> +
> +		if (extent_num_bytes != item_inline_len) {
> +			error(
>  "root %llu EXTENT_DATA[%llu %llu] wrong inline size, have: %llu, expected: %u",
>  				root->objectid, fkey.objectid, fkey.offset,
>  				extent_num_bytes, item_inline_len);
> -		if (repair) {
> -			ret = repair_inline_ram_bytes(root, path,
> -						      &extent_num_bytes);
> -			if (ret)
> +			if (repair) {
> +				ret = repair_inline_ram_bytes(root, path,
> +							      &extent_num_bytes);
> +				if (ret)
> +					err |= FILE_EXTENT_ERROR;
> +			} else {
>  				err |= FILE_EXTENT_ERROR;
> -		} else {
> -			err |= FILE_EXTENT_ERROR;
> +			}
>  		}
>  	}
>  	*end += extent_num_bytes;
> 

  reply	other threads:[~2018-09-14  4:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13 12:05 [PATCH 0/3] Misc refactoring of check_file_extent Nikolay Borisov
2018-09-13 12:05 ` [PATCH 1/3] btrfs-progs: check: lowmem: Factor out inline extent checking code in its own function Nikolay Borisov
2018-09-13 23:05   ` Qu Wenruo
2018-10-31  9:35   ` misono.tomohiro
2018-10-31  9:43     ` Nikolay Borisov
2018-10-31 17:19       ` David Sterba
2018-10-31  9:40   ` misono.tomohiro
2018-09-13 12:05 ` [PATCH 2/3] btrfs-progs: check: lowmem: Refactor extent len test in check_file_extent_inline Nikolay Borisov
2018-09-13 23:07   ` Qu Wenruo [this message]
2018-09-13 12:05 ` [PATCH 3/3] btrfs-progs: check: lowmem: Refactor extent type checks in check_file_extent Nikolay Borisov
2018-09-13 23:08   ` Qu Wenruo
2018-09-13 12:23 ` [PATCH 0/3] Misc refactoring of check_file_extent Lu Fengqi
2018-10-24 17:45 ` David Sterba

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=c273f6d5-6692-b834-552d-ff47fab70943@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.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.