Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Christoph Hellwig <hch@infradead.org>, Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: use IOMAP_DIO_BOUNCE flag instead of falling back to buffered IO
Date: Mon, 25 May 2026 00:23:40 -0700	[thread overview]
Message-ID: <ahP4_BV5QPphEPUC@infradead.org> (raw)
In-Reply-To: <6ff25e6e-ee87-4708-8a86-e4d982edc2df@gmx.com>

On Mon, May 25, 2026 at 04:46:16PM +0930, Qu Wenruo wrote:
> > > +	if (!(inode->flags & BTRFS_INODE_NODATASUM) ||
> > > +	    (data_profile != BTRFS_BLOCK_GROUP_RAID0 && data_profile != 0))
> > 
> > Should the 0 here be BTRFS_RAID_SINGLE for better documentation?
> 
> That BTRFS_RAID_SINGLE is a special enum for iterating btrfs_raid_array[].
> 
> Meanwhile for bit flags we do not use that enum index, even if the values
> match.

Ok.

> > 
> > Also the old code only did this for !BTRFS_INODE_NODATASUM and not
> > raid, right?
> 
> The old code also does the fallback to buffered for raid too.
> 
> That's done in commit 7c2830f00c3e ("btrfs: fallback to buffered IO if the
> data profile has duplication").

Ah, right.

> > Also while you touch this, you should probably also check the
> > bdev_stable_writes similar to XFS (probably yet another patch).
> 
> For btrfs stable writes == data csum so far. But we do not have any bdev
> stable writes checks, thus it will be a pretty huge change if we want to
> take per-dev stable writes into consideration.

I tink you need to.  Various network storage protocols like iSCSI, NVMe
over fabrics or DRBD, as well as T10 data protection for SCSI and NVMe
require stable pages, so you have to take them into account.  My
approach would be to do it globally if any such device is part of the
pool.


  reply	other threads:[~2026-05-25  7:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25  5:05 [PATCH v2] btrfs: use IOMAP_DIO_BOUNCE flag instead of falling back to buffered IO Qu Wenruo
2026-05-25  7:05 ` Christoph Hellwig
2026-05-25  7:16   ` Qu Wenruo
2026-05-25  7:23     ` Christoph Hellwig [this message]
2026-05-25  9:14 ` Qu Wenruo
2026-05-26  0:38   ` Qu Wenruo
2026-05-26  6:38   ` Christoph Hellwig
2026-05-25 23:55 ` Wang Yugui
2026-05-26 17:59 ` Boris Burkov
2026-05-26 21:42   ` 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=ahP4_BV5QPphEPUC@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --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