On Mon, Oct 24, 2016 at 03:22:33PM +0800, Qu Wenruo wrote: > Commit 854437ca(btrfs-progs: extent-tree: avoid allocating tree block > that crosses stripe boundary) introduces check for logical bytenr not > crossing stripe boundary. > > However that check is not completely correct. > It only checks if the logical bytenr and length agaist absolute logical > offset. > That's to say, it only check if a tree block lies in 64K logical stripe. > > But in fact, it's possible a block group starts at bytenr unaligned with > 64K, just like the following case. > > Then btrfsck will give false alert. > > 0 32K 64K 96K 128K 160K ... > |--------------- Block group A --------------------- > |<-----TB 32K------>| > |/Scrub stripe unit/| > | WRONG UNIT | > > In that case, TB(tree block) at bytenr 32K in fact fits into the kernel > scrub stripe unit. > But doesn't fit into the pure logical 64K stripe. > > Fix check_crossing_stripes() to compare bytenr to block group start, not > to absolute logical bytenr. > > Reported-by: Jussi Kansanen <jussi.kansanen@xxxxxxxxx> > Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx> Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
