btrfs: zoned: handle a failed zone finish on one device
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs: zoned: do not fail an ordered extent on a zone finish errorfs/ | +9 | 0 replies | |
| 2/3 | btrfs: zoned: tolerate a failed zone finish on a full block groupfs/ | +42 | 0 replies | |
| 3/3 | btrfs: zoned: do not WARN when zones fail to finish before relocationfs/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] btrfs: zoned: handle a failed zone finish on one device
When ZONE_FINISH fails on one device, btrfs can lose a completed write or turn read-only, even if the profile tolerates the failed device.
1/3: since 7.3, a failed zone finish fails the ordered extent whose completion started it. The data is written, but the file keeps the old data in the range of that extent.
2/3: since 6.18, one failed device of a RAID1 metadata block group turns the filesystem read-only. The patch tolerates the failure when the zones are full. A partly written block group still stops at the first error. Finishing its other zones could make the next mount fail.
3/3: relocation hits a WARN_ON() when a device fails ZONE_FINISH.
Tested in QEMU with KASAN on for-next 65101fe10b30, with two zoned null_blk devices (1 GiB, 16 MiB zones, zone capacity 12 or 16 MiB). A test-only module parameter fails the next ZONE_FINISH on one device. Each RAID1 case ran with a failure on each device:
for-next with the series
RAID1 or single data, an last 1 MiB reads all new data O_DIRECT overwrite fills old data, first the block group read gets EIO
RAID1 metadata fills forced read-only stays writable,
a block group remount works
relocation, RAID1 or WARN_ON() two warning
single data messages
The relocated block groups are partly written, so 2/3 does not tolerate the failure there.
The btrfs self-tests pass. Degraded-mount tests and parallel writers show the same failures as on for-next. These are the bugs fixed by my pending series [1], [2] and [3]. fstests was not run.
Found with FuzzyRAID, a fault-injection tester for RAID that is not public at the moment. It ran the series on an older for-next with my other pending zoned fixes. Its runs showed no lost write and nothing new. The analysis, the fixes and the tests were done with the help of an LLM. I reviewed everything.
[1] https://lore.kernel.org/linux-btrfs/[email protected]/
[2] https://lore.kernel.org/linux-btrfs/[email protected]/
[3] https://lore.kernel.org/linux-btrfs/[email protected]/
Miroslav Cimerman (3):
btrfs: zoned: do not fail an ordered extent on a zone finish error
btrfs: zoned: tolerate a failed zone finish on a full block group
btrfs: zoned: do not WARN when zones fail to finish before relocation
fs/btrfs/relocation.c | 5 +++- fs/btrfs/zoned.c | 59 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 9 deletions(-)
base-commit: 65101fe10b3008186b813b628ee3a611b0e70ce6
Signature · 1 line
2.53.0