Message ID | cover.1705375819.git.wqu@suse.com (mailing list archive) |
---|---|
Headers | show |
Series | btrfs-progs: make convert to generate chunks aligned to stripe boundary | expand |
On Tue, Jan 16, 2024 at 02:01:23PM +1030, Qu Wenruo wrote: > There is a recent report about scrub use-after-free, which is caused by > unaligned chunk length (only aligned to sectorsize, but not to > BTRFS_STRIPE_LEN). > > Although the bug would soon be fixed in kernel, there is no hard to make > convert to generate data chunks with both start and length aligned to > BTRFS_STRIPE_LEN. > > Thankfully the start bytenr is already aligned to 64K, we only need to > make the length aligned. > > Furthermore, allow "btrfs check" to detect such unaligned chunks and > gives a warning (but not consider it as an error). > For selftests, we would utilize the debug environment variable, > BTRFS_PROGS_DEBUG_STRICT_CHUNK_ALIGNMENT, to convert the warning to an > error. > > Qu Wenruo (3): > btrfs-progs: convert: make sure the length of data chunks are also > stripe aligned > btrfs-progs: add extra chunk alignment checks > btrfs-progs: tests: enable strict chunk alignment check Added to devel, with some minor fixups, thanks. The environment variable name is long but it's just for us and it's descriptive, so OK.