linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <dsterba@suse.cz>, <linux-btrfs@vger.kernel.org>, <clm@fb.com>
Subject: Re: Btrfs progs release 4.1
Date: Thu, 10 Sep 2015 08:50:36 +0800	[thread overview]
Message-ID: <55F0D3DC.5090901@cn.fujitsu.com> (raw)
In-Reply-To: <20150909132544.GH8891@suse.cz>



David Sterba wrote on 2015/09/09 15:25 +0200:
> On Wed, Sep 09, 2015 at 11:24:17AM +0800, Qu Wenruo wrote:
>> The problem is that, for converted image, it's quite possible that data
>> and metadata extent are stored in one chunk even the chunk is not mixed.
>>
>> I'll add fsck support for it soon.
>
> That would be great, I have no idea how the data/metadata can get mixed.
> Does this involve inlied file data that come from ext4?
>
Not completely sure yet, but in my case, I didn't put any data into the 
ext4 fs, just newly created one and convert.
And no inline data extent in converted btrfs, checked by debug-tree.

So I think the problem is the chunk allocation algorithm for btrfs-convert.
The algorithm just doesn't check whether the allocated chunk will cover 
ext* data or not, and determine chunk type by a strange data/metadata 
threshold.

To fix it, we'd better rework the algorithm to add more flexibility to 
handle scattered ext* data.
But at the bottom line, every ext* used space should be covered by DATA 
chunk.

Like the following case:
0		1G		2G		3G
|//|		|///|	|//| |//|
Here For range 0~1G, the beginning is some ext* data, but doesn't take 
too much space.
And in range 1G~2G, some ext* extents are scattered there.
Lastly 2G~3G is not used.

For 0~1G, we only need to ensure the beginning part(including the ext* 
range) be covered by a data chunk, the resting part can be either 
allocated for metadata or data of newer btrfs chunk.

For 1G~2G, better to allocate the whole 1G into data chunk, as too many 
scattered ext* space.
For 2G~3G, either DATA or METADATA is OK for further allocation.

But for now, as a hot fix, I prefer the quick but dirty fix that I 
already submitted, just to force btrfs-convert to use mixed-bg patchset
(with fsck support).

The roadmap for convert fix will follow then:
1) Add kernel balance support to convert mixed-bg.
    Seems easier than 2) for me.
2) Add btrfs-convert support to use correct non mixed-bg mode.


But I'm still not sure about whether the bug mail list reported is 
related to the bug we exposed.

Thanks,
Qu

  parent reply	other threads:[~2015-09-10  0:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22 15:00 Btrfs progs release 4.1 David Sterba
2015-06-22 16:18 ` Goffredo Baroncelli
2015-06-22 18:01   ` David Sterba
2015-06-22 18:18 ` qgroup limit clearing, was " Christian Robottom Reis
2015-06-22 23:55   ` Tsutomu Itoh
2015-06-23  1:55     ` Qu Wenruo
2015-06-23 12:42     ` David Sterba
2015-06-22 18:18 ` Christian Robottom Reis
2015-06-22 20:45 ` Martin Steigerwald
2015-06-23 12:53   ` David Sterba
2015-06-23  9:03 ` Sjoerd
2015-06-23  9:18   ` Qu Wenruo
2015-06-23 14:45   ` David Sterba
2015-06-24 20:26     ` Sjoerd
2015-06-25 13:03       ` David Sterba
2015-09-09  1:34 ` Qu Wenruo
2015-09-09  3:24   ` Qu Wenruo
2015-09-09 10:35     ` Vytautas D
2015-09-09 11:25       ` Duncan
2015-09-09 13:26       ` David Sterba
2015-09-09 13:25     ` David Sterba
2015-09-09 14:01       ` Austin S Hemmelgarn
2015-09-10  0:50       ` Qu Wenruo [this message]
2015-09-09 13:19   ` David Sterba

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=55F0D3DC.5090901@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.cz \
    --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).