linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Popa <ierdnah@gmail.com>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: Jan Engelhardt <jengelh@inai.de>, Hugo Mills <hugo@carfax.org.uk>,
	linux-btrfs@vger.kernel.org
Subject: Re: btrfs fi df won't show total=
Date: Thu, 12 Jul 2012 10:59:26 +0300	[thread overview]
Message-ID: <1342079966.26081.36.camel@ierdnac-hp> (raw)
In-Reply-To: <20120709215234.GA1942@zambezi.lan>

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 


      reply	other threads:[~2012-07-12  7:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 19:14 btrfs fi df won't show total= Jan Engelhardt
2012-07-09 19:25 ` Hugo Mills
2012-07-09 20:06   ` Jan Engelhardt
2012-07-09 20:25     ` Hugo Mills
2012-07-09 21:52     ` Ilya Dryomov
2012-07-12  7:59       ` Andrei Popa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1342079966.26081.36.camel@ierdnac-hp \
    --to=ierdnah@gmail.com \
    --cc=hugo@carfax.org.uk \
    --cc=idryomov@gmail.com \
    --cc=jengelh@inai.de \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).