OSDN Git Service

btrfs: Handle btrfs_set_extent_delalloc failure in fixup worker
authorNikolay Borisov <nborisov@suse.com>
Tue, 5 Dec 2017 07:29:19 +0000 (09:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2018 12:21:20 +0000 (13:21 +0100)
commit8fe7ceaf8a4ef194793365339e3e84f7fabdca97
treee2b30cbeb629670ea0ebe8e091bb1b5581b3f0e2
parent3c83fe52b5c1559ea8c1da23ad2c600acc9c6ab3
btrfs: Handle btrfs_set_extent_delalloc failure in fixup worker

commit f3038ee3a3f1017a1cbe9907e31fa12d366c5dcb upstream.

This function was introduced by 247e743cbe6e ("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>
fs/btrfs/inode.c