]> git.hungrycats.org Git - linux/commitdiff
btrfs: raid56: do not call a covered stripe_meta group uncovered
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Wed, 16 Sep 2026 05:20:32 +0000 (01:20 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Wed, 16 Sep 2026 21:40:07 +0000 (17:40 -0400)
report_uncovered_rmw() predates stripe_meta: it treats every metadata
read-modify-write as a write to a group the allocator does not cover
and says so, rate limited, on each one.  With raid56 metadata under
stripe_alloc those writes are partial writes inside one transaction's
run -- the audit it calls first classifies them (meta_rmw_cur) and
warns on its own if one ever rewrites parity over a committed block --
so the message told users of the covered configuration that the write
hole applied to them on every commit:

  read-modify-write of full stripe 42467328: this block group is not
  covered by stripe_alloc, the raid56 write hole applies to it

Keep the counter and the audit, and keep the message for what it was
written for: system chunks and mixed groups.

Assisted-by: Claude:claude-fable-5-1
fs/btrfs/raid56.c

index 7ebeb08f77615d90370bd107acc32966c9bd5e20..66f62b5f6aeef5f0b242cdae1ccbd7bae27ac634 100644 (file)
@@ -3063,6 +3063,8 @@ static void audit_uncovered_rmw(struct btrfs_raid_bio *rbio)
 static void report_uncovered_rmw(struct btrfs_raid_bio *rbio)
 {
        struct btrfs_fs_info *fs_info = rbio->bioc->fs_info;
+       struct btrfs_block_group *bg;
+       bool covered = false;
 
        if (!btrfs_test_opt(fs_info, STRIPE_ALLOC))
                return;
@@ -3077,6 +3079,21 @@ static void report_uncovered_rmw(struct btrfs_raid_bio *rbio)
 
        atomic64_inc(&fs_info->stripe_park_stats.meta_rmw);
        audit_uncovered_rmw(rbio);
+       /*
+        * A raid56 metadata group under stripe_meta is covered: its
+        * read-modify-writes are partial writes inside one transaction's
+        * run, counted by the audit as meta_rmw_cur, and the audit warns
+        * by itself should one ever touch a committed block.  Only system
+        * chunks and mixed groups are the uncovered case this message is
+        * about.
+        */
+       bg = btrfs_lookup_block_group(fs_info, rbio->bioc->full_stripe_logical);
+       if (bg) {
+               covered = btrfs_is_stripe_meta_bg(bg);
+               btrfs_put_block_group(bg);
+       }
+       if (covered)
+               return;
        btrfs_warn_rl(fs_info,
 "read-modify-write of full stripe %llu: this block group is not covered by stripe_alloc, the raid56 write hole applies to it",
                      rbio->bioc->full_stripe_logical);