Accepting request 560042 from filesystems

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/560042
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/btrfsprogs?expand=0&rev=90
This commit is contained in:
Dominique Leuenberger 2018-01-01 21:05:45 +00:00 committed by Git OBS Bridge
commit 4ae356cd6c
3 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Dec 19 11:31:07 UTC 2017 - wqu@suse.de
- Fix rollback regression which can lead to data corruption
Added patches: rollback-regression-fix.patch (bsc#1069478)
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Dec 7 11:03:37 UTC 2017 - dimstar@opensuse.org Thu Dec 7 11:03:37 UTC 2017 - dimstar@opensuse.org

View File

@ -43,6 +43,7 @@ Source4: setup-btrfs.sh
Source5: sles11-defaults.h Source5: sles11-defaults.h
Patch1: mkfs-default-features.patch Patch1: mkfs-default-features.patch
Patch2: rollback-regression-fix.patch
BuildRequires: asciidoc BuildRequires: asciidoc
BuildRequires: autoconf BuildRequires: autoconf
@ -137,6 +138,7 @@ thing.
%prep %prep
%setup -q -n btrfs-progs-v%{version} %setup -q -n btrfs-progs-v%{version}
%patch1 -p1 %patch1 -p1
%patch2 -p1
%build %build
./autogen.sh ./autogen.sh

View File

@ -0,0 +1,35 @@
From: Qu Wenruo <wqu@suse.com>
Subject: [PATCH] btrfs-progs: convert: Fix a bug in rollback check which overwrite return value
Path-mainline: Will land in v4.14.1.
Commit 1170ac307900 ("btrfs-progs: convert: Introduce function to check if
convert image is able to be rolled back") reworked rollback check
condition, by checking 1:1 mapping of each file extent.
The idea itself has nothing wrong, but error handler is not implemented
correctly, which over writes the return value and always try to rollback
the fs even it fails to pass the check.
Fix it by correctly return the error before rollback the fs.
Fixes: 1170ac307900 ("btrfs-progs: convert: Introduce function to check if convert image is able to be rolled back")
Reported-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
convert/main.c | 2 ++
1 file changed, 2 insertions(+)
Index: btrfs-progs-v4.13.3/convert/main.c
===================================================================
--- btrfs-progs-v4.13.3.orig/convert/main.c
+++ btrfs-progs-v4.13.3/convert/main.c
@@ -1443,6 +1443,8 @@ next:
}
}
btrfs_release_path(&path);
+ if (ret)
+ return ret;
/*
* For HOLES mode (without NO_HOLES), we must ensure file extents
* cover the whole range of the image