linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Filipe Manana <fdmanana@gmail.com>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>,
	Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH] btrfs: qgroup: Fix the wrong io_tree when freeing reserved data space
Date: Thu, 12 Sep 2019 08:53:26 +0100	[thread overview]
Message-ID: <CAL3q7H7aycs+JooiFhGec38UK4coVbpjB491vdEGqwHhP_n5bg@mail.gmail.com> (raw)
In-Reply-To: <20190912011306.14858-1-wqu@suse.com>

On Thu, Sep 12, 2019 at 2:31 AM Qu Wenruo <wqu@suse.com> wrote:
>
> Commit bc42bda22345 ("btrfs: qgroup: Fix qgroup reserved space underflow by
> only freeing reserved ranges") is freeing wrong range in
> BTRFS_I()->io_failure_tree, which should be BTRFS_I()->io_tree.

I think you meant wrong tree and not wrong range, since the code
doesn't change the range, only the target tree.

Also, for the sake of completeness, and no matter how obvious you
think it is, can you explicitly mention what's the consequence? I
presume it's a qgroup reserved space leak or underflow.

Thanks.

>
> Just fix it.
>
> Reported-by: Josef Bacik <josef@toxicpanda.com>
> Fixes: bc42bda22345 ("btrfs: qgroup: Fix qgroup reserved space underflow by only freeing reserved ranges")
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  fs/btrfs/qgroup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 2891b57b9e1e..64bdc3e3652d 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -3492,7 +3492,7 @@ static int qgroup_free_reserved_data(struct inode *inode,
>                  * EXTENT_QGROUP_RESERVED, we won't double free.
>                  * So not need to rush.
>                  */
> -               ret = clear_record_extent_bits(&BTRFS_I(inode)->io_failure_tree,
> +               ret = clear_record_extent_bits(&BTRFS_I(inode)->io_tree,
>                                 free_start, free_start + free_len - 1,
>                                 EXTENT_QGROUP_RESERVED, &changeset);
>                 if (ret < 0)
> --
> 2.23.0
>


-- 
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”

  reply	other threads:[~2019-09-12  7:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  1:13 [PATCH] btrfs: qgroup: Fix the wrong io_tree when freeing reserved data space Qu Wenruo
2019-09-12  7:53 ` Filipe Manana [this message]
2019-09-12  8:32   ` Qu Wenruo

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=CAL3q7H7aycs+JooiFhGec38UK4coVbpjB491vdEGqwHhP_n5bg@mail.gmail.com \
    --to=fdmanana@gmail.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@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 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).