]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: handle failure of add_pending_csums
authorNikolay Borisov <nborisov@suse.com>
Mon, 8 Jan 2018 08:59:43 +0000 (10:59 +0200)
committerDavid Sterba <dsterba@suse.com>
Thu, 1 Mar 2018 15:16:00 +0000 (16:16 +0100)
commit72042fbeb418fbf6a7c725e7567758eb6a9305f6
treeec27915237f6e7ad42d31193b175d9bff0d5a036
parentc75050608cf2dfcdae98e5e363fe3040f6aa3571
btrfs: handle failure of add_pending_csums

add_pending_csums was added as part of the new data=ordered
implementation in e6dcd2dc9c48 ("Btrfs: New data=ordered
implementation"). Even back then it called the btrfs_csum_file_blocks
which can fail but it never bothered handling the failure. In ENOMEM
situation this could lead to the filesystem failing to write the
checksums for a particular extent and not detect this. On read this
could lead to the filesystem erroring out due to crc mismatch. Fix it by
propagating failure from add_pending_csums and handling them.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c