Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
To: Chris Mason <clm@fb.com>,
	linux-btrfs@vger.kernel.org, dsterba@suse.com,
	josef@toxicpanda.com, hch@lst.de
Subject: Re: [PATCH RFC] Btrfs: only subtract from len_to_oe_boundary when it is tracking an extent
Date: Sun, 30 Jul 2023 16:27:40 -0400	[thread overview]
Message-ID: <d83bd29b-9744-cf48-c5a5-24668a6ec4f5@dorminy.me> (raw)
In-Reply-To: <20230730190226.4001117-1-clm@fb.com>


> +		/*
> +		 * len_to_oe_boundary defaults to U32_MAX, which isn't page or
> +		 * sector aligned.  So, we don't really want to do math on
> +		 * len_to_oe_boundary unless it has been intentionally set by
> +		 * alloc_new_bio().  If we decrement here, we'll potentially
> +		 * end up sending down an unaligned bio once we get close to
> +		 * zero.
> +		 */

As I understand it, the important part is: nothing should use 
len_to_oe_boundary unless there's an actual oe boundary, U32_MAX is just 
a placeholder to convey the information that there's no oe boundary.

So maybe:
/*
  * len_to_oe_boundary being U32_MAX indicates that no ordered extent was
  * found by alloc_new_bio(), so there's no boundary.
  */

I think talking about doing math on U32_MAX here obscures the main point.

Otherwise the bug, and fix, looks good to me.

  reply	other threads:[~2023-07-30 20:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-30 19:02 [PATCH RFC] Btrfs: only subtract from len_to_oe_boundary when it is tracking an extent Chris Mason
2023-07-30 20:27 ` Sweet Tea Dorminy [this message]
2023-07-31 19:22   ` Chris Mason
2023-08-01  2:59     ` Sweet Tea Dorminy
2023-07-31  2:27 ` Qu Wenruo
2023-07-31  7:02   ` Christoph Hellwig
2023-07-31 18:10     ` Chris Mason
2023-08-01  0:58       ` Qu Wenruo
2023-07-31  7:00 ` Christoph Hellwig
2023-07-31 18:52   ` Chris Mason
2023-07-31 19:35     ` Christoph Hellwig
2023-07-31 21:05       ` Chris Mason

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=d83bd29b-9744-cf48-c5a5-24668a6ec4f5@dorminy.me \
    --to=sweettea-kernel@dorminy.me \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.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