mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Korenberg via B4 Relay <devnull+socketpair.gmail.com@kernel.org>
To: David Sterba <dsterba@suse.com>, Chris Mason <mason@kernel.org>
Cc: Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Mark Korenberg <socketpair@gmail.com>
Subject: [PATCH v2 1/2] btrfs: tag tree block repair writes with REQ_META
Date: Fri, 06 Nov 2026 22:33:09 +0500	[thread overview]
Message-ID: <20261106-btrfs-sb-read-req-meta-v2-1-71c1afaf5c67@gmail.com> (raw)
In-Reply-To: <20261106-btrfs-sb-read-req-meta-v2-0-71c1afaf5c67@gmail.com>

From: Mark Korenberg <socketpair@gmail.com>

When a tree block read finds a bad copy, btrfs_repair_eb_io_failure()
rewrites it from a good one through btrfs_repair_bbio_failure().  That
rewrite is a plain REQ_OP_WRITE | REQ_SYNC, while the read that found
the bad copy and all other tree block writes carry REQ_META.

Tag it with REQ_META when the bbio belongs to the btree inode.

Signed-off-by: Mark Korenberg <socketpair@gmail.com>
---
 fs/btrfs/bio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c
index 2e12a6d7e16f..efbce4d549ff 100644
--- a/fs/btrfs/bio.c
+++ b/fs/btrfs/bio.c
@@ -951,7 +951,8 @@ int btrfs_repair_bbio_failure(struct btrfs_bio *bbio, const struct bvec_iter *or
 	}
 
 	repair_bio = bio_alloc(smap.dev->bdev, max(1, length >> PAGE_SHIFT),
-			       REQ_OP_WRITE | REQ_SYNC, GFP_NOFS);
+			       REQ_OP_WRITE | REQ_SYNC |
+			       (is_data_inode(inode) ? 0 : REQ_META), GFP_NOFS);
 	repair_bio->bi_iter.bi_sector = smap.physical >> SECTOR_SHIFT;
 	while (cur < length) {
 		struct page *page = bio_iter_page(&bbio->bio, iter);

-- 
2.56.0



  reply	other threads:[~2026-11-06 17:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 17:33 [PATCH v2 0/2] btrfs: tag tree block repair and RAID5/6 metadata I/O " Mark Korenberg via B4 Relay
2026-11-06 17:33 ` Mark Korenberg via B4 Relay [this message]
2026-11-06 20:31   ` [PATCH v2 1/2] btrfs: tag tree block repair writes " Qu Wenruo
2026-11-06 17:33 ` [PATCH v2 2/2] btrfs: raid56: pass REQ_META to per-device bios Mark Korenberg via B4 Relay
2026-11-06 20:26   ` 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=20261106-btrfs-sb-read-req-meta-v2-1-71c1afaf5c67@gmail.com \
    --to=devnull+socketpair.gmail.com@kernel.org \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mason@kernel.org \
    --cc=socketpair@gmail.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

all inboxes | Powered by JetHome®