From: Chandan Rajendra <chandan@linux.vnet.ibm.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.cz, t-itoh@jp.fujitsu.com
Subject: Re: [PATCH v2 2/3] btrfs-progs: convert: Rework rollback to handle new convert image
Date: Fri, 16 Dec 2016 11:41:49 +0530 [thread overview]
Message-ID: <3301134.NkFMPhqS6q@localhost.localdomain> (raw)
In-Reply-To: <20161215090331.27486-3-quwenruo@cn.fujitsu.com>
On Thursday, December 15, 2016 05:03:30 PM Qu Wenruo wrote:
> Although commit 9c4b820412746b3 tried to make the rollback condition
> less restrict, to co-operate with new rollback behavior, it's still too
> restrict.
>
> If btrfs allocates a new data chunk, it's highly possible that the new
> chunk will not be 1:1 mapped anymore.
>
> And this makes old rollback check fails, and refuse to rollback.
>
> This patch rework it by checking rollback condition more accurately.
>
> 1) Rollback condition
> Unlike old chunk level check, we use file extent level check.
> So we manually check every file extents of convert image file.
>
> Only when all file extents except ones in btrfs relocated ranges(*)
> are mapped 1:1 we allow rollback.
>
> This behavior make both old and new behavior happy.
> *:
> [0, 1M)
> [btrfs_sb_offset(1), +64K)
> [btrfs_sb_offset(2), +64K)
>
> 2) Rollback method
> Old rollback method is quite complex, using extent_io tree to mark
> every checked ranges.
> And do extra chunk tree operation before rollback.
>
> The new rollback method is quite simple.
> 1) open btrfs
> 2) read and save relocated data
> 3) close btrfs
> 4) write relocated into place.
>
> Such rework fixes the following problem
> 1) rollback failure after new data chunk allocation
> 2) rollback failure after correct NO_HOLES convert
Hi Qu,
With this patch applied, I get the following on an x86_64 machine,
[root@localhost]~/btrfs-progs# btrfs-convert -r /dev/loop0
ctree.c:1112: btrfs_search_slot: Warning: assertion `p->nodes[0] != NULL` failed, value 1
btrfs-convert(btrfs_search_slot+0x117)[0x40c906]
btrfs-convert(btrfs_lookup_dir_item+0x70)[0x41d902]
btrfs-convert(main+0x5e2)[0x43af50]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7f7fb6168700]
btrfs-convert(_start+0x29)[0x408a69]
extent buffer leak: start 67305472 len 16384
rollback complete
The same error occurs on a ppc64 machine when using 64k sectorsize.
The three 'rollback' patches were applied on top of commit
9ce512ac57cb08edf2f742da085c383834f804dd (i.e. btrfs-progs: check: Fix false
alert on generation mismatch for tree reloc tree) that is available on David's
devel branch.
--
chandan
next prev parent reply other threads:[~2016-12-16 6:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-15 9:03 [PATCH v2 0/3] Convert rollback rework for v4.9 Qu Wenruo
2016-12-15 9:03 ` [PATCH v2 1/3] btrfs-progs: file-item: Fix wrong file extents inserted Qu Wenruo
2016-12-15 9:03 ` [PATCH v2 2/3] btrfs-progs: convert: Rework rollback to handle new convert image Qu Wenruo
2016-12-16 6:11 ` Chandan Rajendra [this message]
2016-12-16 8:38 ` Qu Wenruo
2016-12-15 9:03 ` [PATCH v2 3/3] btrfs-progs: convert-test: trigger chunk allocation after convert Qu Wenruo
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=3301134.NkFMPhqS6q@localhost.localdomain \
--to=chandan@linux.vnet.ibm.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo@cn.fujitsu.com \
--cc=t-itoh@jp.fujitsu.com \
/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).