On Wed, Mar 18, 2015 at 02:57:31AM +0100, Sebastian Thorarensen wrote: > On Mon, 16 Mar 2015, David Sterba wrote: > > I think it's right, however I'm not sure if there are any guarantees > > about the range alignment. Btrfs should be fine with 4k (ie. sectorsize > > which is PAGE_SIZE) alignment for a node, but this could lead to some > > pathological layout and I'm not 100% sure the exact nodesize alignment > > is not required somewhere. > > Ah, I didn't think of that. Yes, ext2_alloc_block_range can allocate > unaligned (with respect to nodesize) ranges. > > I made a test with a conversion that resulted in unaligned blocks[], and > neither btrfs check nor scrub complained on the converted filesystem, but > I will do some research to find out whether blocks[] must be aligned or > not. Thanks for the test. So far I haven't found any requirements for the exact nodesize alignment for metadata blocsk, I think it's safe. Given that the node allocation is opencoded inside convert, we can easily add a fallback to request a bit larger range and satisfy the alignment. This would leave the small unallocatable ranges behind and outside of the btrfs' sight. I'm fine with current code for first implementation. -- 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
