aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/rust/pin-init/internal/src
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2025-07-29 19:01:45 +0930
committerDavid Sterba <dsterba@suse.com>2025-08-13 14:08:44 +0200
commit4bcd3061e8154606af7f721cb75ca04ffe191a12 (patch)
tree83e1d2cd8d2e35dbb0acbf421c2ae9a3c7fbf991 /rust/pin-init/internal/src
parentbtrfs: zoned: limit active zones to max_open_zones (diff)
downloadwireguard-linux-4bcd3061e8154606af7f721cb75ca04ffe191a12.tar.xz
wireguard-linux-4bcd3061e8154606af7f721cb75ca04ffe191a12.zip
btrfs: clear block dirty if submit_one_sector() failed
[BUG] If submit_one_sector() failed, the block will be kept dirty, but with their corresponding range finished in the ordered extent. This means if a writeback happens later again, we can hit the following problems: - ASSERT(block_start != EXTENT_MAP_HOLE) in submit_one_sector() If the original extent map is a hole, then we can hit this case, as the new ordered extent failed, we will drop the new extent map and re-read one from the disk. - DEBUG_WARN() in btrfs_writepage_cow_fixup() This is because we no longer have an ordered extent for those dirty blocks. The original for them is already finished with error. [CAUSE] The function submit_one_sector() is not following the regular error handling of writeback. The common practice is to clear the folio dirty, start and finish the writeback for the block. This is normally done by extent_clear_unlock_delalloc() with PAGE_START_WRITEBACK | PAGE_END_WRITEBACK flags during run_delalloc_range(). So if we keep those failed blocks dirty, they will stay in the page cache and wait for the next writeback. And since the original ordered extent is already finished and removed, depending on the original extent map, we either hit the ASSERT() inside submit_one_sector(), or hit the DEBUG_WARN() in btrfs_writepage_cow_fixup(). [FIX] Follow the regular error handling to clear the dirty flag for the block, start and finish writeback for that block instead. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'rust/pin-init/internal/src')
0 files changed, 0 insertions, 0 deletions