Re: [PATCH v3 2/3] btrfs: block-group: Refactor btrfs_read_block_groups()

David Sterba
2019-11-04T21:44:19Z

On Mon, Nov 04, 2019 at 08:53:52PM +0100, David Sterba wrote:
> On Wed, Oct 30, 2019 at 04:59:17AM +0000, Qu WenRuo wrote:
> >
> >
> > On 2019/10/10 上午10:39, Qu Wenruo wrote:
> > > Refactor the work inside the loop of btrfs_read_block_groups() into one
> > > separate function, read_one_block_group().
> > >
> > > This allows read_one_block_group to be reused for later BG_TREE feature.
> > >
> > > The refactor does the following extra fix:
> > > - Use btrfs_fs_incompat() to replace open-coded feature check
> > >
> > > Signed-off-by: Qu Wenruo <wqu@suse.com>
> > > Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
> > > Reviewed-by: Anand Jain <anand.jain@oracle.com>
> >
> > Hi David,
> >
> > Mind to add this patch to for-next branch?
> >
> > Considering the recent changes to struct btrfs_block_group_cache, there
> > is some considerable conflicts.
>
> I see, as the patch is idependent I'll add it.
>
> > It would be much easier to solve them sooner than later.
> > If needed I could send a newer version based on latest for-next branch.
>
> I've fixed the conflicts, but please have a look anyway. The change was
> cache->item to local block group item and rename of found_key to key in
> read_one_block_group.

And it crashes during the self-tests, the patch is in branch
misc-next-with-bg-refactoring in my github tree, please have a look.
I've removed it from misc-next for now as I need to test for-next, but
it's probably going to be some trivial typo so the patch will be added
once it's found. Thanks.