public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 0/2] btrfs: enhance BTRFS_ORDERED_* flags sanity checks
Date: Mon, 16 Mar 2026 09:49:50 +0100	[thread overview]
Message-ID: <20260316084950.GN5735@twin.jikos.cz> (raw)
In-Reply-To: <cover.1773446363.git.wqu@suse.com>

On Sat, Mar 14, 2026 at 10:30:37AM +1030, Qu Wenruo wrote:
> [CHANGELOG]
> v2:
> - Minor grammar fixes
> - Change the output message when overlapping OEs are found
> - Use has_single_bit_set() to replace hweight*()
> 
> 
> During my development of introduce a new DELAYED type, I incorrectly
> called something like:
> 
> 	oe = alloc_ordered_extent(.., BTRFS_ORDERED_DELAYED, ..);
> 
> That doesn't trigger any warning at runtime, but will cause unexpected
> bugs due to the fact that, BTRFS_ORDERED_* can not be directly used as a
> flag. They are only bit numbers, thus should be utilized with bit
> operations like "test_bit(BTRFS_ORDERED_DELAYED, ..)".
> 
> My stupid bug inspired me to enhance the @flags sanity checks in
> alloc_ordered_extent().
> 
> The first one is to make sure that my stupid bug can always be caught
> early.
> 
> The second one is to enhance the error message when a duplicated OE is
> found during insert_ordered_extent().
> 
> Qu Wenruo (2):
>   btrfs: check type flags in alloc_ordered_extent()
>   btrfs: output more info when duplicated ordered extent is found

Reviewed-by: David Sterba <dsterba@suse.com>

      parent reply	other threads:[~2026-03-16  8:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-14  0:00 [PATCH v2 0/2] btrfs: enhance BTRFS_ORDERED_* flags sanity checks Qu Wenruo
2026-03-14  0:00 ` [PATCH v2 1/2] btrfs: check type flags in alloc_ordered_extent() Qu Wenruo
2026-03-14  0:00 ` [PATCH v2 2/2] btrfs: output more info when duplicated ordered extent is found Qu Wenruo
2026-03-16  8:49 ` David Sterba [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=20260316084950.GN5735@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --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