mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
btrfs: Handle btrfs_set_extent_delalloc failure in fixup worker
commitf3038ee3a3upstream. This function was introduced by247e743cbe("Btrfs: Use async helpers to deal with pages that have been improperly dirtied") and it didn't do any error handling then. This function might very well fail in ENOMEM situation, yet it's not handled, this could lead to inconsistent state. So let's handle the failure by setting the mapping error bit. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3c83fe52b5
commit
8fe7ceaf8a
@@ -2063,8 +2063,15 @@ again:
|
||||
goto out;
|
||||
}
|
||||
|
||||
btrfs_set_extent_delalloc(inode, page_start, page_end, &cached_state,
|
||||
0);
|
||||
ret = btrfs_set_extent_delalloc(inode, page_start, page_end,
|
||||
&cached_state, 0);
|
||||
if (ret) {
|
||||
mapping_set_error(page->mapping, ret);
|
||||
end_extent_writepage(page, ret, page_start, page_end);
|
||||
ClearPageChecked(page);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ClearPageChecked(page);
|
||||
set_page_dirty(page);
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user