• Qu Wenruo's avatar
    btrfs: make btrfs_truncate_block() to be subpage compatible · 6c9ac8be
    Qu Wenruo authored
    
    
    btrfs_truncate_block() itself is already mostly subpage compatible, the
    only missing part is the page dirtying code.
    
    Currently if we have a sector that needs to be truncated, we set the
    sector aligned range delalloc, then set the full page dirty.
    
    The problem is, current subpage code requires subpage dirty bit to be
    set, or __extent_writepage_io() won't submit bio, thus leads to ordered
    extent never to finish.
    
    So this patch will make btrfs_truncate_block() to call
    btrfs_page_set_dirty() helper to replace set_page_dirty() to fix the
    problem.
    
    Tested-by: Ritesh Harjani <riteshh@linux.ibm.com> # [ppc64]
    Tested-by: Anand Jain <anand.jain@oracle.com> # [aarch64]
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    6c9ac8be
inode.c 299 KB