All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Cc: ochmann@informatik.uni-bonn.de
Subject: Re: [PATCH] Btrfs: fix wrong superblock generation mismatch while scrubbing superblocks
Date: Mon, 02 Dec 2013 12:01:56 +0800	[thread overview]
Message-ID: <529C0634.1080800@cn.fujitsu.com> (raw)
In-Reply-To: <1385952751-4251-1-git-send-email-wangsl.fnst@cn.fujitsu.com>

On 12/02/2013 10:52 AM, Wang Shilong wrote:
> While scrubbing superblocks we will check every superblock's checksum
> and generation. However, checking superblock's generation may cause
> some problems, this is because tree log sync only flush first superblock
> , while this will cause other superblocks' generation mismatch.
>
> We only report superblock generation mismatch if it is first superblock
> or we make sure we are not doing tree log.
I am sorry, My miss, this is not true, because tree log won't update 
superblock's
generation. I will try to track this issue as soon as possible.

>
> Reported-by: Sebastian Ochmann <ochmann@informatik.uni-bonn.de>
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
> Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
Miao is innocent, he found my fault as soon as possible.
don't blame him.

> ---
>   fs/btrfs/scrub.c | 11 +++++++++--
>   1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index 2544805..b29a91f 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -1794,8 +1794,15 @@ static int scrub_checksum_super(struct scrub_block *sblock)
>   	if (sblock->pagev[0]->logical != btrfs_super_bytenr(s))
>   		++fail_cor;
>   
> -	if (sblock->pagev[0]->generation != btrfs_super_generation(s))
> -		++fail_gen;
> +	if (sblock->pagev[0]->generation != btrfs_super_generation(s)) {
> +		/*
> +		 * we only report a generation mismatch if this is first
> +		 * superblock or we can make sure we are not doing tree log.
> +		 */
> +		if (btrfs_super_bytenr(s) == btrfs_sb_offset(0) ||
> +				!root->fs_info->log_root_tree)
> +			++fail_gen;
> +	}
>   
>   	if (memcmp(s->fsid, fs_info->fsid, BTRFS_UUID_SIZE))
>   		++fail_cor;


      reply	other threads:[~2013-12-02  4:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02  2:52 [PATCH] Btrfs: fix wrong superblock generation mismatch while scrubbing superblocks Wang Shilong
2013-12-02  4:01 ` Wang Shilong [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=529C0634.1080800@cn.fujitsu.com \
    --to=wangsl.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=ochmann@informatik.uni-bonn.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.