All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <dsterba@suse.cz>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v2] btrfs-progs: Doc: Add warning and note on btrfs-convert.
Date: Fri, 3 Apr 2015 08:37:56 +0800	[thread overview]
Message-ID: <551DE0E4.6080502@cn.fujitsu.com> (raw)
In-Reply-To: <20150402151931.GK6821@twin.jikos.cz>



-------- Original Message  --------
Subject: Re: [PATCH v2] btrfs-progs: Doc: Add warning and note on 
btrfs-convert.
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Date: 2015年04月02日 23:19

> On Thu, Mar 26, 2015 at 10:19:24AM +0800, Qu Wenruo wrote:
>> +WARNING: To ensure *btrfs-convert* be able to rollback btrfs, one should never
>> +execute *btrfs filesystem defragment* or *btrfs balance* command on the
>> +converted btrfs.
>
> So it looks like a fundamental problem, not lack of implementation. The
> original filesystem has some correspondence between physical blocks (1:1
> match in ext) and btrfs blocks (where the mapping is not 1:1, though
> from the beginning physical matches logical).
>
> Once we balance data, the chunks get moved and the original phyisical
> offset is lost. We'd have to remember that somewhere and restore upon
> rollback.
>
> I don't see now why defrag is harmful to rollback. The defragmented data
> are written to the "ext free space", ie. where all new modifications get
> written. The old data are pinned by the ext2_saved subvolume and can be
> restored. Or not?
>
Oh, I forgot ext*_image is readonly, so defrag should be OK.

I'll remove defrag from warning.

BTW, although we use 1:1 physical bytenr and if the extent is moved, we 
lost its physical bytenr, but we still have its offset in ext*_image, 
and its logical file offset is the same as its original physical bytenr.

So, why not use file offset as physical bytenr to do rollback?
It should make btrfs-convert to rollback even after balance.

Thanks,
Qu


  reply	other threads:[~2015-04-03  0:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26  2:19 [PATCH v2] btrfs-progs: Doc: Add warning and note on btrfs-convert Qu Wenruo
2015-04-02 15:19 ` David Sterba
2015-04-03  0:37   ` Qu Wenruo [this message]
2015-04-03  4:37   ` Duncan

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=551DE0E4.6080502@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.