• Filipe Manana's avatar
    Btrfs: fix hang on compressed write error · fce2a4e6
    Filipe Manana authored
    In inode.c:submit_compressed_extents(), before calling btrfs_submit_compressed_write()
    we start writeback for all pages, clear their dirty flag, unlock them, etc, but if
    btrfs_submit_compressed_write() fails (at the moment it can only fail with -ENOMEM),
    we never end the writeback on the pages, so any filemap_fdatawait_range() call will
    hang forever. We were also not calling the writepage end io hook, which means the
    corresponding ordered extent will never complete and all its waiters will block
    forever, such as a full fsync (via btrfs_wait_ordered_range()).
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarChris Mason <clm@fb.com>
    fce2a4e6
inode.c 251 KB