btrfs: test if btrfs will corrupt nodatasum compressed extent when replacing device
authorQu Wenruo <wqu@suse.com>
Thu, 14 Jun 2018 06:30:53 +0000 (14:30 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 1 Jul 2018 12:35:27 +0000 (20:35 +0800)
commit73576ea71e1aae3f74fb844f5dec13d2ef2d0560
tree814ab0aa49d35c2e3ae530883fa6f33d4f0a3cff
parent103258a566b41aeea128597f244f408ab99e0612
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>
tests/btrfs/167 [new file with mode: 0755]
tests/btrfs/167.out [new file with mode: 0644]
tests/btrfs/group