linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Hans van Kranenburg <hans.van.kranenburg@mendix.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Experiences with metadata balance/convert
Date: Fri, 21 Apr 2017 07:27:52 -0400	[thread overview]
Message-ID: <e89a08de-b0f1-2151-2f62-b37a0cfcb351@gmail.com> (raw)
In-Reply-To: <6054483d-437f-e8d2-f74b-7560c9e0819d@mendix.com>

On 2017-04-21 07:13, Hans van Kranenburg wrote:
> On 04/21/2017 12:31 PM, Hans van Kranenburg wrote:
>> Doh,
>>
>> On 04/21/2017 12:26 PM, Hans van Kranenburg wrote:
>>> [...]
>>>
>>> == Thinking out of the box ==
>>>
>>> Technically, converting from DUP to single could also mean:
>>> * Flipping one bit in the block group type flags to 0 for each block
>>> group item
>>> * Flipping one bit in the chunk type flags and removing 1 stripe struct
>>> for each metadata chunk item
>>> * Removing the
>>
>> Removing the dev extent objects for all removed stripes from the dev tree.
>>
>>> * Anything else?
>>>
>>> How feasible would it be to write btrfs-progs style conversion to do this?
>
> From the feedback on IRC already, to clear things up:
>
> I'm *not* proposing/asking for this kind of functionality to be
> officially available or added to mainline btrfs-progs and be supported
> for every user to use. I understand that's a whole different kind of
> discussion.
>
> I only mean... would there be any great show-stopper for this idea which
> would mean I couldn't technically do it myself in a 'one-off' style.
>
Not that I know of, but it would be kind of nice to have an upstream 
version too (especially if it could handle raid1 to single conversion).

To be entirely honest though, the current profile conversion stuff is 
somewhat braindead.  It appears to assume that there is only one 
partially filled chunk (IOW,  that you just ran a full balance), and 
therefore does some seriously extraneous work.  This in turn scales 
multiplicatively based on how much data needs converted.

WIth a proper design, raid1 or dup to single should just drop the extra 
copy, single to dup or raid1 should just be adding an extra copy, and 
raid1 to dup or dup to raid1 should just move one of the copies, but 
doing that would make things seriously more complicated.

  reply	other threads:[~2017-04-21 11:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 10:26 Experiences with metadata balance/convert Hans van Kranenburg
2017-04-21 10:31 ` Hans van Kranenburg
2017-04-21 11:13   ` Hans van Kranenburg
2017-04-21 11:27     ` Austin S. Hemmelgarn [this message]
2017-04-22  9:17 ` Duncan
2017-04-22 21:18   ` Hans van Kranenburg
2017-04-22 16:45 ` Chris Murphy
2017-04-22 16:55   ` Chris Murphy
2017-04-22 20:22     ` Hans van Kranenburg
2017-04-22 20:33       ` Hans van Kranenburg
2017-04-22 20:21   ` Hans van Kranenburg
2017-04-23  9:45     ` Hans van Kranenburg

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=e89a08de-b0f1-2151-2f62-b37a0cfcb351@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=hans.van.kranenburg@mendix.com \
    --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).