Re: [PATCH 4/4] btrfs: convert: Avoid allocating metadata extent crossing stripe boundary

2015-07-27 Thread David Sterba
On Sat, Jul 25, 2015 at 09:18:54AM +0800, Qu Wenruo wrote: This caught my attention and looking at possible values of num_bytes, this can crash: 1291 for (last_byte = 0; last_byte first_free; last_byte += sectorsize) { 1292 ret = custom_alloc_extent(root,

Re: [PATCH 4/4] btrfs: convert: Avoid allocating metadata extent crossing stripe boundary

2015-07-24 Thread Qu Wenruo
David Sterba wrote on 2015/07/24 14:34 +0200: On Thu, Jul 23, 2015 at 05:18:10PM +0800, Qu Wenruo wrote: @@ -246,6 +247,14 @@ static int custom_alloc_extent(struct btrfs_root *root, u64 num_bytes, continue; } + if (metadata) { +

Re: [PATCH 4/4] btrfs: convert: Avoid allocating metadata extent crossing stripe boundary

2015-07-24 Thread David Sterba
On Thu, Jul 23, 2015 at 05:18:10PM +0800, Qu Wenruo wrote: @@ -246,6 +247,14 @@ static int custom_alloc_extent(struct btrfs_root *root, u64 num_bytes, continue; } + if (metadata) { + BUG_ON(num_bytes != root-nodesize);

[PATCH 4/4] btrfs: convert: Avoid allocating metadata extent crossing stripe boundary

2015-07-23 Thread Qu Wenruo
As convert implement its own alloc extent, avoid such metadata problem too. Reported-by: Chris Murphy li...@colorremedies.com Reported-by: Zhao Lei zhao...@cn.fujitsu.com Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- btrfs-convert.c | 15