]> git.hungrycats.org Git - linux/commitdiff
covers: rb1101 misc-next (for-next a919d4a3e831): Josef 1/5 replaces our split-bio...
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Mon, 2 Nov 2026 02:29:08 +0000 (21:29 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Mon, 2 Nov 2026 02:29:08 +0000 (21:29 -0500)
raid56-fixes cover: 10 patches (Qu pair in for-next and the base; Josef 1/5
as patch 3, ours dropped), renumbered, new base.  stripe-alloc cover: Josef
2/5-4/5 at the head, 3/5 v1 with the open Sashiko race report.
replace-fixes cover + TESTING.md: Josef 5/5 carried at the head until
upstream takes it.  allocator-hints cover: Cheng v2 at the head.
raid56-scrub-replace cover: Filipe prerequisite hash = current for-next
0bade584e95b9.  Not a re-export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
topics/allocator-hints/0000-cover-letter.patch
topics/raid56-fixes/0000-cover-letter.patch
topics/raid56-scrub-replace/0000-cover-letter.patch
topics/replace-fixes/0000-cover-letter.patch
topics/replace-fixes/TESTING.md
topics/stripe-alloc/0000-cover-letter.patch

index bbc0ea3196db5db156f29ff512cd1f9f4773ea8a..d17bc63556bc524429aceba03adbd2e5eee0387b 100644 (file)
@@ -17,6 +17,14 @@ included so the lane's branch applies as one series.
 
 Follow-ups:
 
+On misc-next the topic also carries, at its head and ahead of the
+patches numbered here, Cheng Yongkang's "[PATCH v2] btrfs: remove devid
+kobject when deleting a missing device" (2026-10-26, Reviewed-by: Qu
+Wenruo), as posted, until upstream takes it: deleting a missing device
+freed the btrfs_device with its devid kobject still registered, so
+reading any devinfo attribute was a use-after-free, and patch 4 adds a
+writable attribute under that kobject.
+
 Patch 9 moves the hint values out of the UAPI header into
 fs/btrfs/volumes.h: a CONFIG_ symbol in a UAPI header makes
 "make headers_install" (and the deb/rpm package targets) fail.
index d4083085dc1f09ae7e326c4ccaab55beec2eb13f..724243e1580f6fe9a9d223c6a0bb85c0d3b17057 100644 (file)
@@ -1,25 +1,19 @@
 From a4b35a2e9704dbbb331f8931774d6d433c4bffeb Mon Sep 17 00:00:00 2001
 From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
 Date: Sat, 31 Oct 2026 01:04:01 -0400
-Subject: [PATCH 00/12] btrfs: raid56: rbio lifetime and cache fixes, error reporting
+Subject: [PATCH 00/10] btrfs: raid56: rbio lifetime and cache fixes, error reporting
 To: linux-btrfs@vger.kernel.org
 
 Fixes found running raid56 filesystems to ENOSPC under fsstress with a
 dead or silently corrupting member.  The patches are independent of
 each other unless noted.
 
-Patches 1 and 2 are Qu Wenruo's "btrfs: raid56: minor fixes to
-rmw_rbio()", as posted (Reviewed-by: Filipe Manana, Link: tags in the
-patches).  They are included because patch 12 applies on top of patch
-2; if they are merged first, "git am --skip" drops them here.  Patch 1
-closes a race in which a bio merged into an rbio that failed early was
-never ended.  Patch 2 stops an rbio whose write failed from being cached
-for page stealing: a later sub-stripe write to the same full stripe
-would otherwise take those pages instead of reading the disk and compute
-parity over data the failed members never got.  It replaces a fix of
-our own for the same bug.
-
-Patch 3 logs a message when an extent is dropped because its write
+Qu Wenruo's "btrfs: raid56: minor fixes to rmw_rbio()" (2 patches,
+Reviewed-by: Filipe Manana), which this series used to carry at its
+head, is in btrfs/for-next (2976d37925785, f750b1dd48985) and in the
+base; patch 10 applies on top of it.
+
+Patch 1 logs a message when an extent is dropped because its write
 failed.  The error reaches userspace only through fsync or syncfs, and a
 process that wrote a file and exited with its data still in dirty pages
 is never told.  The message carries both the logical address (which
@@ -27,7 +21,7 @@ files lost data) and the disk bytenr (which part of the address space
 refused the write), since the mapping between them is gone by the time
 the error is handled.
 
-Patch 4 fixes a use-after-free of the rbio in the bio end_io wakeups.
+Patch 2 fixes a use-after-free of the rbio in the bio end_io wakeups.
 The submission rounds count in-flight bios with an atomic and wait with
 wait_event(); the waiter can see the counter reach zero and free the
 rbio while the last end_io is still inside wake_up() on the rbio's
@@ -35,11 +29,15 @@ embedded waitqueue.  Under KVM this shows up as recurring
 "pvqspinlock: lock ... has corrupted value" warnings; on bare metal it
 is silent.  The pair becomes a completion.
 
-Patch 5 propagates a split bio's error when the split that failed is
-not the last to complete; the error was dropped when the last split
-succeeded.  Not raid56-specific.  Fixes: d48e1dea3931.
+Patch 3 is Josef Bacik's "btrfs: don't drop the error of the last split
+bio" (1/5 of his "btrfs: data integrity fixes", 2026-10-30, Reviewed-by:
+Qu Wenruo), as posted.  A split bio's error was dropped when the split
+that failed was not the last to complete and the last one succeeded.
+Not raid56-specific.  Fixes: d48e1dea3931.  It replaces our own patch
+for the same bug (identical code, different comment); it is carried
+here until upstream takes it, and "git am --skip" drops it then.
 
-Patch 6 drops cached rbios when their stripes' extents are freed.  A
+Patch 4 drops cached rbios when their stripes' extents are freed.  A
 cached rbio's pages can be stolen by a later sub-stripe write to the
 same full stripe after the space was freed and reallocated, so parity
 is generated from the cache's memory of the stripe's previous contents
@@ -48,7 +46,7 @@ corrupted in between, the new parity matches the stale cache, every
 read and scrub passes, and reconstruction after a device failure
 returns garbage.  Proven byte-exactly on a raid5 test array.
 
-Patch 7 verifies reconstructed tree blocks.  Data sectors rebuilt from
+Patch 5 verifies reconstructed tree blocks.  Data sectors rebuilt from
 parity are checked against their csums; metadata was handed back
 unverified, and on raid6 the right one of several candidate
 reconstructions could not be chosen.  The tree block's own header csum
@@ -56,16 +54,16 @@ is checked once every sector of the block has been recovered.  Scrub's
 reads are left out: they cover free space too, and scrub verifies the
 sectors that hold extents itself.
 
-Patches 8 and 9 fix two races around the rbio cache, both seen as
+Patches 6 and 7 fix two races around the rbio cache, both seen as
 crashes on a degraded raid5 array under fsstress and made frequent by
-patch 6's trimming, but reachable with the in-tree cache shrink:
+patch 4's trimming, but reachable with the in-tree cache shrink:
 lock_stripe_add()'s steal path drops the hash reference before removing
 the rbio from the cache, so a concurrent removal frees it under the
-stealing thread (patch 8); and a cache removal can unhash an rbio that
+stealing thread (patch 6); and a cache removal can unhash an rbio that
 has rbios plugged on it and hit BUG_ON(!list_empty(&rbio->plug_list))
-(patch 9).
+(patch 7).
 
-Patch 10 makes a RAID6 RMW rebuild from Q when a sector rebuilt from P
+Patch 8 makes a RAID6 RMW rebuild from Q when a sector rebuilt from P
 fails its csum.  The RMW read phase verifies data sectors and rebuilds a
 failed one once, from P; P has no csum, so a stale P (left by a write
 that failed within tolerance on a data member and the P member) makes
@@ -75,7 +73,7 @@ the allocator hands the same free space out again.  Read repair already
 walks P, Q and P+Q; the RMW now retries in the same order.
 Fixes: 7a3150723061.
 
-Patch 11 counts raid56 member I/O errors in the device stats.  raid56
+Patch 9 counts raid56 member I/O errors in the device stats.  raid56
 submits its stripe bios itself and their end_io only marked the rbio's
 error bitmap, so a raid56 write or read that failed on a member (within
 tolerance, so the operation succeeded) was never counted in
@@ -83,9 +81,9 @@ write_io_errs or read_io_errs: a failing member looked healthy in
 `btrfs device stats`.  The device is found by the bio's bdev, so writes
 to a replace target are charged to the target.  Fixes: 53b381b3abeb.
 
-Patch 12 makes a sub-stripe write write back the sectors its RMW read
+Patch 10 makes a sub-stripe write write back the sectors its RMW read
 repaired.  The read phase verifies data sectors against their csums and
-rebuilds bad ones (and, with patch 10, a stale P or Q), but only the new
+rebuilds bad ones (and, with patch 8, a stale P or Q), but only the new
 data and parity were written, so the repaired strip stayed stale on
 disk until read repair or scrub found it.  Csummed data sectors, P/Q
 with an error bit, and nodatasum sectors rebuilt from P+Q together with
@@ -93,15 +91,12 @@ a verified csummed sector of the same row are written back; a missing
 device never is, and a failed write-back does not count against the
 write's tolerance.  Fixes: 7a3150723061.
 
-Qu Wenruo (2):
-  btrfs: fix racy bio_list changes for failed RMW rbio
-  btrfs: don't cache rbio if an error is hit
+Josef Bacik (1):
+  btrfs: don't drop the error of the last split bio
 
-Zygo Blaxell (10):
+Zygo Blaxell (9):
   btrfs: log a message when dropping an extent due to IO error
   btrfs: raid56: fix use-after-free of rbio in bio end_io wakeups
-  btrfs: propagate a split bio's error when the failing split completes
-    last
   btrfs: raid56: drop cached rbios when their stripes' extents are freed
   btrfs: raid56: verify reconstructed tree blocks
   btrfs: raid56: keep a reference on a stolen cached rbio until it is
@@ -113,16 +108,16 @@ Zygo Blaxell (10):
   btrfs: raid56: count I/O errors in the device stats
   btrfs: raid56: write back the sectors a sub-stripe write repaired
 
- fs/btrfs/bio.c         |  13 +-
+ fs/btrfs/bio.c         |  11 +-
  fs/btrfs/bio.h         |   2 +
  fs/btrfs/extent-tree.c |  10 +
  fs/btrfs/inode.c       |  16 ++
- fs/btrfs/raid56.c      | 626 +++++++++++++++++++++++++++++++++++++----
+ fs/btrfs/raid56.c      | 591 ++++++++++++++++++++++++++++++++++++++---
  fs/btrfs/raid56.h      |  11 +-
- 6 files changed, 626 insertions(+), 52 deletions(-)
+ 6 files changed, 601 insertions(+), 40 deletions(-)
 
 
-base-commit: bf921b86bdf225f19ffd41533f5c779fba99012e
+base-commit: 83cd81353093be02aa7e60874c413ec340e55bce
 -- 
 2.47.3
 
index 95be5618d31f7b39ac82883be2f0a4608ef2bf36..48a0be19dc15850641ded67abf7e719ce8ab2ed4 100644 (file)
@@ -12,7 +12,7 @@ the scrub or replace moves on, and the rows of a full stripe that can
 still be verified are verified and copied.
 
 The series applies on top of Filipe Manana's "btrfs: scrub: fix lost
-error return value when scrubbing raid56 parity stripe" (ec0795c045c3
+error return value when scrubbing raid56 parity stripe" (0bade584e95b9
 in for-next), which this base contains.
 
 It also applies on top of the series "btrfs: read repair and scrub
index e3d126c28e0999c475cc70cc2dd16df657384ba7..9eea82769cba6036683822e5b537934b7133b01a 100644 (file)
@@ -11,6 +11,12 @@ after the filesystem has had an error.  This series restores the
 counters, fixes those three failures and what a failed replace leaves
 behind, and adds an option to abort a replace on uncorrectable data.
 
+On misc-next the topic also carries, at its head and ahead of the
+patches numbered here, Josef Bacik's "btrfs: don't trim the target of a
+device replace" (5/5 of "btrfs: data integrity fixes", 2026-10-30,
+Reviewed-by: Qu Wenruo), as posted, until upstream takes it: FITRIM
+during a replace discarded everything already copied to the target.
+
 Patch 1 commits the CANCELED state when a replace fails or is canceled.
 btrfs_dev_replace_finishing() updated the item but did not commit, so
 on an idle filesystem the item still said STARTED at unmount and the
index 18cb56e0717e9683710306635871ae6bb13ae224..2d5749a14572e03dca656ef86679c22c4b29c3bf 100644 (file)
@@ -162,7 +162,8 @@ skips every chunk regardless, is untouched.
 ## Replace with discards (2026-10-31)
 
 Test: `replace-discard-test.sh` + `replace-discard.py` (rd; TEST-CATALOG
-5t).  **The bug it finds is upstream and is NOT fixed by this topic**:
+5t).  **The bug it finds is upstream; Josef 5/5 is carried at the head
+of this topic until upstream takes it** (since rb1101, 2026-11-01):
 Josef Bacik, "[PATCH 5/5] btrfs: don't trim the target of a device
 replace" (linux-btrfs 2026-10-30, R-b Qu, Fixes 499f377f49f0).
 `btrfs_trim_free_extents()` discards every range of a writeable device
@@ -270,8 +271,8 @@ discards.
 - `alloc-hints-replace-test.sh` (part of the retrofit set) was not rerun:
   it belongs to allocator-hints.
 - FITRIM during a replace discards the target (Josef Bacik's 5/5, see
-  "Replace with discards"): upstream, not fixed by this series; the
-  candidate refs/cand/josef-trim/{618,mn} fixes it on both lanes.
+  "Replace with discards"): Josef 5/5 carried at the head until upstream
+  takes it (it is not one of this series' own patches).
 - replace-abort-test.sh was not rerun with discards (~100 min, ~100 GiB).
 
 ### Questions for Zygo
index 0228613d2624784e9f35301348aaa0dd52f6a156..b6d74da4a8b0a49032f4d38f89dfc8e823746c2f 100644 (file)
@@ -26,6 +26,20 @@ its later parts are titled "<subject> (<subtopic> part)" and sit in the
 subtopic they belong to.  The series applies on top of reclaim-fixes
 ("btrfs: block group reclaim fixes for a full filesystem", 3 patches).
 
+On misc-next the topic also carries, at its head and ahead of the 85
+patches numbered here, three of Josef Bacik's "btrfs: data integrity
+fixes" (2026-10-30), as posted, until upstream takes them: 2/5 "btrfs:
+clear dirty blocks after a delalloc failure" (Reviewed-by: Qu Wenruo),
+3/5 "btrfs: make fsync wait after pre-submission errors" and 4/5
+"btrfs: don't report success for a skipped log sync".  They fix the
+fsync and writeback error paths that a stripe_alloc ENOSPC drop at the
+fill edge goes through.  3/5 is v1 with an open race report: a Sashiko
+"Critical" finding that Qu forwarded on 2026-10-31.  Every caller clears
+folio writeback before can_finish_ordered_extent() sets
+BTRFS_INODE_COW_WRITE_ERROR, so a fast fsync that runs in between still
+sees neither writeback nor the flag and can log the unwritten extent.
+The patch narrows that window and does not close it; no v2 yet.
+
 The write hole
 ==============