All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miao Xie <miaox@cn.fujitsu.com>
To: Stefan Behrens <sbehrens@giantdisaster.de>,
	<linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] Btrfs: check-int: don't complain about balanced blocks
Date: Fri, 17 Oct 2014 16:06:05 +0800	[thread overview]
Message-ID: <5440CDED.8010907@cn.fujitsu.com> (raw)
In-Reply-To: <1413474529-7251-2-git-send-email-sbehrens@giantdisaster.de>

On Thu, 16 Oct 2014 17:48:49 +0200, Stefan Behrens wrote:
> The xfstest btrfs/014 which tests the balance operation caused that the
> check_int module complained that known blocks changed their physical
> location. Since this is not an error in this case, only print such
> message if the verbose mode was enabled.
> 
> Reported-by: Wang Shilong <wangshilong1991@gmail.com>
> Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
> ---
>  fs/btrfs/check-integrity.c | 87 ++++++++++++++++++++++++++--------------------
>  1 file changed, 49 insertions(+), 38 deletions(-)
> 
> diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
> index 65fc2e0bbc4a..65226d7c9fe0 100644
> --- a/fs/btrfs/check-integrity.c
> +++ b/fs/btrfs/check-integrity.c
> @@ -1325,24 +1325,28 @@ static int btrfsic_create_link_to_next_block(
>  		l = NULL;
>  		next_block->generation = BTRFSIC_GENERATION_UNKNOWN;
>  	} else {
> -		if (next_block->logical_bytenr != next_bytenr &&
> -		    !(!next_block->is_metadata &&
> -		      0 == next_block->logical_bytenr)) {
> -			printk(KERN_INFO
> -			       "Referenced block @%llu (%s/%llu/%d)"
> -			       " found in hash table, %c,"
> -			       " bytenr mismatch (!= stored %llu).\n",
> -			       next_bytenr, next_block_ctx->dev->name,
> -			       next_block_ctx->dev_bytenr, *mirror_nump,
> -			       btrfsic_get_block_type(state, next_block),
> -			       next_block->logical_bytenr);
> -		} else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
> -			printk(KERN_INFO
> -			       "Referenced block @%llu (%s/%llu/%d)"
> -			       " found in hash table, %c.\n",
> -			       next_bytenr, next_block_ctx->dev->name,
> -			       next_block_ctx->dev_bytenr, *mirror_nump,
> -			       btrfsic_get_block_type(state, next_block));
> +		if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) {
> +			if (next_block->logical_bytenr != next_bytenr &&
> +			    !(!next_block->is_metadata &&
> +			      0 == next_block->logical_bytenr))
> +				printk(KERN_INFO
> +				       "Referenced block @%llu (%s/%llu/%d)"
> +				       " found in hash table, %c,"
> +				       " bytenr mismatch (!= stored %llu).\n",

According to the coding style, we don't expect the user-visible strings are broken.

Thanks
Miao

> +				       next_bytenr, next_block_ctx->dev->name,
> +				       next_block_ctx->dev_bytenr, *mirror_nump,
> +				       btrfsic_get_block_type(state,
> +							      next_block),
> +				       next_block->logical_bytenr);
> +			else
> +				printk(KERN_INFO
> +				       "Referenced block @%llu (%s/%llu/%d)"
> +				       " found in hash table, %c.\n",
> +				       next_bytenr, next_block_ctx->dev->name,
> +				       next_block_ctx->dev_bytenr, *mirror_nump,
> +				       btrfsic_get_block_type(state,
> +							      next_block));
> +		}
>  		next_block->logical_bytenr = next_bytenr;
>  
>  		next_block->mirror_num = *mirror_nump;
> @@ -1528,7 +1532,9 @@ static int btrfsic_handle_extent_data(
>  				return -1;
>  			}
>  			if (!block_was_created) {
> -				if (next_block->logical_bytenr != next_bytenr &&
> +				if ((state->print_mask &
> +				     BTRFSIC_PRINT_MASK_VERBOSE) &&
> +				    next_block->logical_bytenr != next_bytenr &&
>  				    !(!next_block->is_metadata &&
>  				      0 == next_block->logical_bytenr)) {
>  					printk(KERN_INFO
> @@ -1881,25 +1887,30 @@ again:
>  							       dev_state,
>  							       dev_bytenr);
>  			}
> -			if (block->logical_bytenr != bytenr &&
> -			    !(!block->is_metadata &&
> -			      block->logical_bytenr == 0))
> -				printk(KERN_INFO
> -				       "Written block @%llu (%s/%llu/%d)"
> -				       " found in hash table, %c,"
> -				       " bytenr mismatch"
> -				       " (!= stored %llu).\n",
> -				       bytenr, dev_state->name, dev_bytenr,
> -				       block->mirror_num,
> -				       btrfsic_get_block_type(state, block),
> -				       block->logical_bytenr);
> -			else if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE)
> -				printk(KERN_INFO
> -				       "Written block @%llu (%s/%llu/%d)"
> -				       " found in hash table, %c.\n",
> -				       bytenr, dev_state->name, dev_bytenr,
> -				       block->mirror_num,
> -				       btrfsic_get_block_type(state, block));
> +			if (state->print_mask & BTRFSIC_PRINT_MASK_VERBOSE) {
> +				if (block->logical_bytenr != bytenr &&
> +				    !(!block->is_metadata &&
> +				      block->logical_bytenr == 0))
> +					printk(KERN_INFO
> +					       "Written block @%llu (%s/%llu/%d)"
> +					       " found in hash table, %c,"
> +					       " bytenr mismatch"
> +					       " (!= stored %llu).\n",
> +					       bytenr, dev_state->name,
> +					       dev_bytenr,
> +					       block->mirror_num,
> +					       btrfsic_get_block_type(state,
> +								      block),
> +					       block->logical_bytenr);
> +				else
> +					printk(KERN_INFO
> +					       "Written block @%llu (%s/%llu/%d)"
> +					       " found in hash table, %c.\n",
> +					       bytenr, dev_state->name,
> +					       dev_bytenr, block->mirror_num,
> +					       btrfsic_get_block_type(state,
> +								      block));
> +			}
>  			block->logical_bytenr = bytenr;
>  		} else {
>  			if (num_pages * PAGE_CACHE_SIZE <
> 


  parent reply	other threads:[~2014-10-17  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 15:48 [PATCH 1/2] Btrfs: check_int: use the known block location Stefan Behrens
2014-10-16 15:48 ` [PATCH 2/2] Btrfs: check-int: don't complain about balanced blocks Stefan Behrens
2014-10-17  7:16   ` Wang Shilong
2014-10-17  8:06   ` Miao Xie [this message]
2014-10-17  7:15 ` [PATCH 1/2] Btrfs: check_int: use the known block location Wang Shilong

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=5440CDED.8010907@cn.fujitsu.com \
    --to=miaox@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sbehrens@giantdisaster.de \
    /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.