On Mon, May 18, 2020 at 01:13:34PM +0800, Qu Wenruo wrote: > > This is using 1 as ino number, which means root::highest_objectid is not > > properly initialized. > > > > This happened when I'm using btrfs_read_tree_root() other than > > btrfs_read_fs_root(), which initializes root::highest_objectid. > > After fetching the misc-next branch, that's exactly the problem. > > The 3rd patch is using the correct btrfs_get_fs_root() which won't > trigger the problem. Looking at it futher, btrfs_get_fs_root does a few more things that does not seem to be necessary for the data reloc tree. The following two should be sufficient: - btrfs_read_tree_root - btrfs_init_fs_root but with btrfs_get_fs_root there's an orphan item check and the data reloc tree is added to fs_roots_radix.
