summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2026-04-07 19:03:58 +0930
committerJohannes Thumshirn <johannes.thumshirn@wdc.com>2026-06-09 18:22:44 +0200
commit15a12af71c3e8ad239b538038aa18d2ed6bee7d4 (patch)
tree139c4d6957349f54bc38293da0daa5a1b49aa6c1 /include/linux
parenta6908f88c9da9778957a07ac568aa643124278a8 (diff)
btrfs: remove the dev stats item for replace target device
[MINOR PROBLEM] When a running dev-replace hits some error for the target device (devid 0), there will be a DEV_STATS with error records created at the next transaction commit. Unfortunately that item will never to be deleted. This means at the next dev-replace, if the replace is interrupted, then at the next mount, the target device will suddenly inherit the old error records from that DEV_STATS item, which can give some false alerts on that device. This shouldn't affect end users that much, as it requires all the following conditions to be met, which is pretty rare: - The initial dev-replace hits some error on the target device E.g. write errors, but those errors itself is already a big problem for a running replace. This is required to create the DEV_STATS item in the first place. - The next replace is interrupted This is required to allow btrfs to read from the old records. [CAUSE] Btrfs just never deletes the DEV_STATS after a replace is finished. [FIX] Remove the DEV_STATS item for devid 0 after the replace is finished. This is not going to completely fix the error, as we still have other error paths, e.g. by somehow the fs flips RO and can not start a new transaction for the DEV_STATS item removal. But those corner cases will be addressed by later patches which provide a more generic fix to DEV_STATS related problems. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions