• Boris Burkov's avatar
    btrfs: implement launder_folio for clearing dirty page reserve · 872617a0
    Boris Burkov authored
    In the buffered write path, dirty pages can be said to "own" the qgroup
    reservation until they create an ordered_extent. It is possible for
    there to be outstanding dirty pages when a transaction is aborted, in
    which case there is no cancellation path for freeing this reservation
    and it is leaked.
    
    We do already walk the list of outstanding delalloc inodes in
    btrfs_destroy_delalloc_inodes() and call invalidate_inode_pages2() on them.
    
    This does *not* call btrfs_invalidate_folio(), as one might guess, but
    rather calls launder_folio() and release_folio(). Since this is a
    reservation associated with dirty pages only, rather than something
    associated with the private bit (ordered_extent is cancelled separately
    already in the cleanup transaction path), implementing this release
    should be done via launder_folio.
    Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarBoris Burkov <boris@bur.io>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    872617a0
inode.c 288 KB