Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Boris Burkov <boris@bur.io>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 4/5] btrfs: dont clear qgroup rsv bit in release_folio
Date: Tue, 5 Dec 2023 07:39:35 +1030	[thread overview]
Message-ID: <5dc3b769-2411-4766-b862-d8154aa01780@gmx.com> (raw)
In-Reply-To: <9a8e2f9639330dd5e82db11a49f84fa17cb9988d.1701464169.git.boris@bur.io>



On 2023/12/2 07:30, Boris Burkov wrote:
> The EXTENT_QGROUP_RESERVED bit is used to "lock" regions of the file for
> duplicate reservations. That is two writes to that range in one
> transaction shouldn't create two reservations, as the reservation will
> only be freed once when the write finally goes down. Therefore, it is
> never OK to clear that bit without freeing the associated qgroup rsv. At
> this point, we don't want to be freeing the rsv, so mask off the bit.

Did you have any dmesg output for this case? I believe this would lead
to a underflow.
>
> Signed-off-by: Boris Burkov <boris@bur.io>

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

Thanks,
Qu
> ---
>   fs/btrfs/extent_io.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 0143bf63044c..87283087c669 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -2310,7 +2310,8 @@ static int try_release_extent_state(struct extent_io_tree *tree,
>   		ret = 0;
>   	} else {
>   		u32 clear_bits = ~(EXTENT_LOCKED | EXTENT_NODATASUM |
> -				   EXTENT_DELALLOC_NEW | EXTENT_CTLBITS);
> +				   EXTENT_DELALLOC_NEW | EXTENT_CTLBITS
> +				   | EXTENT_QGROUP_RESERVED);
>
>   		/*
>   		 * At this point we can safely clear everything except the

  reply	other threads:[~2023-12-04 21:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 21:00 [PATCH 0/5] btrfs: qgroups rsv fixes Boris Burkov
2023-12-01 21:00 ` [PATCH 1/5] btrfs: free qgroup rsv on ioerr ordered_extent Boris Burkov
2023-12-04 21:04   ` Qu Wenruo
2023-12-05 19:42     ` Boris Burkov
2023-12-05 20:16       ` Qu Wenruo
2023-12-01 21:00 ` [PATCH 2/5] btrfs: fix qgroup_free_reserved_data int overflow Boris Burkov
2023-12-04 21:07   ` Qu Wenruo
2023-12-01 21:00 ` [PATCH 3/5] btrfs: free qgroup pertrans rsv on trans abort Boris Burkov
2023-12-04 21:08   ` Qu Wenruo
2023-12-05 14:27   ` David Sterba
2023-12-05 19:45     ` Boris Burkov
2023-12-05 22:39       ` David Sterba
2023-12-01 21:00 ` [PATCH 4/5] btrfs: dont clear qgroup rsv bit in release_folio Boris Burkov
2023-12-04 21:09   ` Qu Wenruo [this message]
2023-12-01 21:00 ` [PATCH 5/5] btrfs: ensure releasing squota rsv on head refs Boris Burkov
2023-12-05 17:09 ` [PATCH 0/5] btrfs: qgroups rsv fixes 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=5dc3b769-2411-4766-b862-d8154aa01780@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=boris@bur.io \
    --cc=kernel-team@fb.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