Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:GA
btrfsprogs
0021-btrfs-progs-Convert-Add-support-for-rollba...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0021-btrfs-progs-Convert-Add-support-for-rollback-new-con.patch of Package btrfsprogs
From: Qu Wenruo <quwenruo@cn.fujitsu.com> Date: Fri, 29 Jan 2016 13:03:30 +0800 Subject: btrfs-progs: Convert: Add support for rollback new convert behavior Git-commit: e5724bfc8e015835154b77a6e2b1eb7ed4b9f16c Patch-mainline: v4.6 References: bsc#1042369 Add support to rollback new btrfs-convert. The support is quite easy unlike the new convert behavior, which in fact makes the rollback less restricted. The core is, rollback must support both old and new convert result. For old convert, all fs image extents can be covered by any chunk type. But any extents inside reserved range must be covered by chunk. For new convert, all fs image extents are covered by data chunk. Allowing any condition will just make another fail to pass. So make the convert condition a little less restricted to allow both can be converted. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com> --- btrfs-convert.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/btrfs-convert.c b/btrfs-convert.c index 3b72232..51e496c 100644 --- a/btrfs-convert.c +++ b/btrfs-convert.c @@ -3828,11 +3828,19 @@ static int do_rollback(const char *devname) num_bytes = btrfs_file_extent_num_bytes(leaf, fi); cache1 = btrfs_lookup_block_group(root->fs_info, offset); - cache2 = btrfs_lookup_block_group(root->fs_info, - offset + num_bytes - 1); - if (!cache1 || cache1 != cache2 || - (!(cache1->flags & BTRFS_BLOCK_GROUP_SYSTEM) && - !intersect_with_sb(offset, num_bytes))) + cache2 = btrfs_lookup_block_group(root->fs_info, + offset + num_bytes - 1); + /* + * Here we must take consideration of old and new convert + * behavior. + * For old convert case, sign, there is no consist chunk type + * that will cover the extent. META/DATA/SYS are all possible. + * Just ensure relocate one is in SYS chunk. + * For new convert case, they are all covered by DATA chunk. + * + * So, there is not valid chunk type check for it now. + */ + if (cache1 != cache2) break; set_extent_bits(&io_tree, offset, offset + num_bytes - 1, @@ -3846,6 +3854,7 @@ next_extent: if (offset < total_bytes) { fprintf(stderr, "unable to build extent mapping\n"); + fprintf(stderr, "converted filesystem after balance is unable to rollback\n"); goto fail; } -- 2.12.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor