btrfs: test if btrfs will corrupt nodatasum compressed extent when replacing device
This is a long existing bug (from 2012) but exposed by a reporter
recently, that when compressed extent without data csum get written
to device-replace target device, the written data is in fact
uncompressed data other than the original compressed data.
And since btrfs still consider the data is compressed and will try
to read it as compressed, it can cause read error.
This is fixed by kernel commit
ac0b4145d662 ("btrfs: scrub: Don't
use inode pages for device replace")
Reported-by: James Harvey <jamespharvey20@gmail.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>