]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: do not write corrupted metadata blocks to disk
authorAlex Lyakas <alex.bolshoy@gmail.com>
Thu, 10 Mar 2016 11:10:15 +0000 (13:10 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 22 Mar 2016 09:08:12 +0000 (10:08 +0100)
commitac49be67f1a1371494654c2559d0502b9f4a6537
tree67ac073abecb56e21a03d7ec45043578984a6cba
parent47625532c6e396cd63763e668850e6bfd9c5cf40
btrfs: do not write corrupted metadata blocks to disk

csum_dirty_buffer was issuing a warning in case the extent buffer
did not look alright, but was still returning success.
Let's return error in this case, and also add an additional sanity
check on the extent buffer header.
The caller up the chain may BUG_ON on this, for example flush_epd_write_bio will,
but it is better than to have a silent metadata corruption on disk.

Signed-off-by: Alex Lyakas <alex@zadarastorage.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c