Re: btrfs fi df won't show total=

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2012-07-10 at 00:52 +0300, Ilya Dryomov wrote: 
> mkfs creates those non-raid chunks for a pretty stupid reason, they
> really shouldn't be there if you create a raid10 fs.  Balance does the
> right thing and removes them.  Fixing this along with another mkfs
> annoyance related to this one is on my TODO list.

Hi Ilya,

I've also studied this bug and found where the problem is, if this will
help you:

In mkfs.c, "make_root_dir" function creates the first system and
metadata chunk:
        ret = btrfs_make_block_group(trans, root, bytes_used,
                                     BTRFS_BLOCK_GROUP_SYSTEM,
                                     BTRFS_FIRST_CHUNK_TREE_OBJECTID,
                                     0, BTRFS_MKFS_SYSTEM_GROUP_SIZE);
....
                ret = btrfs_alloc_chunk(trans,
root->fs_info->extent_root,
                                        &chunk_start, &chunk_size,
                                        BTRFS_BLOCK_GROUP_METADATA |
                                        BTRFS_BLOCK_GROUP_DATA);
                BUG_ON(ret);
                ret = btrfs_make_block_group(trans, root, 0,
                                             BTRFS_BLOCK_GROUP_METADATA
|
                                             BTRFS_BLOCK_GROUP_DATA,

BTRFS_FIRST_CHUNK_TREE_OBJECTID,
                                             chunk_start, chunk_size);

And these chunks are created again in "create_raid_groups" function.
Both functions, "make_root_dir" and "create_raid_groups" are called from
"main" function.

Andrei 

--
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


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux