Re: [PATCH] fstests: btrfs: Test if btrfs will corrupt nodatasum compressed extent when replacing device

Eryu Guan
2018-06-28T05:34:25Z

On Thu, Jun 28, 2018 at 08:11:00AM +0300, Nikolay Borisov wrote:
>
>
> On 1.06.2018 04:34, Qu Wenruo wrote:
> > 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.
> >
> > The root cause is located, and one RFC patch already sent to fix it,
> > titled "[PATCH RFC] btrfs: scrub: Don't use inode pages for device replace".
> > (The RFC is only for the extra possible way to fix the bug, the fix
> > itself should work without problem)
> >
> > Reported-by: James Harvey <jamespharvey20@gmail.com>
> > Signed-off-by: Qu Wenruo <wqu@suse.com>
>
> Reviewed-by: Nikolay Borisov <nborisov@suse.com>

Thanks for the review! I assume the v3 patch also passes your review :)

Eryu