mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-08 18:57:22 +00:00
btrfs: don't fail writeback when allocating the compression context fails
[ Upstream commit973fb26e81] If cow_file_range_async fails to allocate the asynchronous writeback context, it currently returns an error and entirely fails the writeback. This is not a good idea as a writeback failure is a non-temporary error condition that will make the file system unusable. Just fall back to synchronous uncompressed writeback instead. This requires us to delay setting the BTRFS_INODE_HAS_ASYNC_EXTENT flag until we've committed to the async writeback. The compression checks INODE_NOCOMPRESS and FORCE_COMPRESS are moved from cow_file_range_async to the preceding checks btrfs_run_delalloc_range(). Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Stable-dep-of:7027f87108("btrfs: don't treat zoned writeback as being from an async helper thread") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0e0e5d0b47
commit
52f788a170
1 changed files with 28 additions and 46 deletions
Loading…
Add table
Add a link
Reference in a new issue