summaryrefslogtreecommitdiff
path: root/scripts/extract-fwblobs
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2025-07-28 17:57:56 +0930
committerDavid Sterba <dsterba@suse.com>2025-09-23 08:49:15 +0200
commit13141df705b7145e46b88b1147d67d7a43f2d9e8 (patch)
tree5216f3605618c770db1418b56851916f8c6927b3 /scripts/extract-fwblobs
parent6a378edc9a61f0276e9c0261b0d65b2353c7f9e4 (diff)
btrfs: make nocow_one_range() to do cleanup on error
Currently if we hit an error inside nocow_one_range(), we do not clear the page dirty, and let the caller to handle it. This is very different compared to fallback_to_cow(), when that function failed, everything will be cleaned up by cow_file_range(). Enhance the situation by: - Use a common error handling for nocow_one_range() If we failed anything, use the same btrfs_cleanup_ordered_extents() and extent_clear_unlock_delalloc(). btrfs_cleanup_ordered_extents() is safe even if we haven't created new ordered extent, in that case there should be no OE and that function will do nothing. The same applies to extent_clear_unlock_delalloc(), and since we're passing PAGE_UNLOCK | PAGE_START_WRITEBACK | PAGE_END_WRITEBACK, it will also clear folio dirty flag during error handling. - Avoid touching the failed range of nocow_one_range() As the failed range will be cleaned up and unlocked by that function. Here we introduce a new variable @nocow_end to record the failed range, so that we can skip it during the error handling of run_delalloc_nocow(). Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts/extract-fwblobs')
0 files changed, 0 insertions, 0 deletions