• Qu Wenruo's avatar
    btrfs: remove the BUG_ON() inside extent_range_clear_dirty_for_io() · a3948437
    Qu Wenruo authored
    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: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    a3948437
inode.c 288 KB