linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Edmund Nadolski <enadolski@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: add missing initialization in btrfs_check_shared
Date: Wed, 14 Mar 2018 17:09:47 +0200	[thread overview]
Message-ID: <f471fca5-d24b-799a-03a5-f9492752e09d@suse.com> (raw)
In-Reply-To: <20180314150311.20152-2-enadolski@suse.com>



On 14.03.2018 17:03, Edmund Nadolski wrote:
> btrfs_check_shared calls find_parent_nodes in a loop. In each
> iteration it passes in a share_check struct to request a check for
> a shared extent.  The share_check::share_count must be re-initialized
> to zero for each iteration in order to avoid using a stale count
> value from the previous iteration, thus causing a false
> shared extent indication.
> 
> Signed-off-by: Edmund Nadolski <enadolski@suse.com>

Is there a particular commit which introduced this regression (i.e. one
of the backref walking series)? It would be useful to know so that this
can be tagged with a Fixes: tag and perhaps stable.

Also your cover letter should go as a changelog in the patch so that we
have a proper history of how this fix came to be :)

> ---
>  fs/btrfs/backref.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
> index 4e89598..4a33448 100644
> --- a/fs/btrfs/backref.c
> +++ b/fs/btrfs/backref.c
> @@ -1519,6 +1519,7 @@ int btrfs_check_shared(struct btrfs_root *root, u64 inum, u64 bytenr)
>  		if (!node)
>  			break;
>  		bytenr = node->val;
> +		shared.share_count = 0;
>  		cond_resched();
>  	}
>  
> 

  reply	other threads:[~2018-03-14 15:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 15:03 [PATCH] missing initialization in btrfs_check_shared Edmund Nadolski
2018-03-14 15:03 ` [PATCH] btrfs: add " Edmund Nadolski
2018-03-14 15:09   ` Nikolay Borisov [this message]
2018-03-14 15:24   ` David Sterba
2018-03-14 15:08 ` [PATCH] " Filipe Manana
2018-03-16 18:20 ` Liu Bo

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=f471fca5-d24b-799a-03a5-f9492752e09d@suse.com \
    --to=nborisov@suse.com \
    --cc=enadolski@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).