]> www.infradead.org Git - nvme.git/commit
btrfs: remove the BUG_ON() inside extent_range_clear_dirty_for_io()
authorQu Wenruo <wqu@suse.com>
Thu, 23 May 2024 01:19:38 +0000 (10:49 +0930)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Jul 2024 13:52:25 +0000 (15:52 +0200)
commita39484371dd29ed9ba67bfd211e51d72b1a35c3d
treebee027400c2c9b4e65d66a47892dd99ff8180229
parentaf61081fb522ab52bc7f7d8304b4a7cc4f606575
btrfs: remove the BUG_ON() inside extent_range_clear_dirty_for_io()

Previously we had a BUG_ON() inside extent_range_clear_dirty_for_io(), as
we expected all involved folios to be still locked, thus no folio should be
missing.

However for extent_range_clear_dirty_for_io() itself, we can skip the
missing folio and handle the remaining ones, and return an error if
there is anything wrong.

Remove the BUG_ON() and let the caller to handle the error.
In the caller we do not have a quick way to cleanup the error, but all
the compression routines would handle the missing folio as an error and
properly error out, so we only need to do an ASSERT() for developers,
while for non-debug build the compression routine would handle the
error correctly.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c