[util-linux/f18] 2.22.2-2: fix #889888

kzak kzak at fedoraproject.org
Fri Jan 11 09:35:59 UTC 2013


commit f1717db54e38c03730606c2028e90f47778727ac
Author: Karel Zak <kzak at redhat.com>
Date:   Fri Jan 11 10:32:17 2013 +0100

    2.22.2-2: fix #889888
    
    Signed-off-by: Karel Zak <kzak at redhat.com>

 ...d-add-support-for-btrfs-backup-superblock.patch |   46 ++++++++++++++++++++
 util-linux.spec                                    |    9 +++-
 2 files changed, 54 insertions(+), 1 deletions(-)
---
diff --git a/libblkid-add-support-for-btrfs-backup-superblock.patch b/libblkid-add-support-for-btrfs-backup-superblock.patch
new file mode 100644
index 0000000..e8a3ea8
--- /dev/null
+++ b/libblkid-add-support-for-btrfs-backup-superblock.patch
@@ -0,0 +1,46 @@
+From d4a276491269b6502c15e0089fba6b616f5c5df8 Mon Sep 17 00:00:00 2001
+From: Goffredo Baroncelli <kreijack at inwind.it>
+Date: Wed, 9 Jan 2013 22:14:43 +0100
+Subject: [PATCH] libblkid: add support for btrfs backup superblock
+
+Btrfs has three superblock. The first one is placed at 64KB, the second one at
+64MB, the third one at 256GB.
+
+If the first superblock is valid except that the "magic field" is zeroed, btrfs
+skips the check of the other superblocks.  If the first superblock is fully
+invalid, btrfs checks for the other superblock.
+
+So zeroing the first superblock "magic field" at the beginning seems that the
+filesystem is wiped. But when the first superblock is overwritten (eg by
+another filesystem), then the other two superblock may be considered valid, and
+the filesystem may resurrect.
+
+This patch allow to find and wipe the other btrfs superblocks signature.
+
+Signed-off-by: Karel Zak <kzak at redhat.com>
+---
+ libblkid/src/superblocks/btrfs.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/libblkid/src/superblocks/btrfs.c b/libblkid/src/superblocks/btrfs.c
+index 039be42..1bd1df9 100644
+--- a/libblkid/src/superblocks/btrfs.c
++++ b/libblkid/src/superblocks/btrfs.c
+@@ -87,6 +87,14 @@ const struct blkid_idinfo btrfs_idinfo =
+ 	.magics		=
+ 	{
+ 		{ .magic = "_BHRfS_M", .len = 8, .kboff = 64, .sboff = 0x40 },
++		{ .magic = "_BHRfS_M",
++		  .len = 8,
++		  .kboff = 64 * 1024,
++		  .sboff = 0x40 },
++		{ .magic = "_BHRfS_M",
++		  .len = 8,
++		  .kboff = 256 * 1024 * 1024,
++		  .sboff = 0x40 },
+ 		{ NULL }
+ 	}
+ };
+-- 
+1.7.11.7
+
diff --git a/util-linux.spec b/util-linux.spec
index 8f79fa0..ab1fed3 100644
--- a/util-linux.spec
+++ b/util-linux.spec
@@ -2,7 +2,7 @@
 Summary: A collection of basic system utilities
 Name: util-linux
 Version: 2.22.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain
 Group: System Environment/Base
 URL: http://en.wikipedia.org/wiki/Util-linux
@@ -83,6 +83,10 @@ Patch3: util-linux-ng-2.21-login-lastlog.patch
 # 231192 - ipcs is not printing correct values on pLinux
 Patch4: util-linux-2.21-ipcs-32bit.patch
 
+###
+### Upstream patches (2.23 or 2.22.x)
+# 889888 - wipefs does not completely wipe btrfs volume
+Patch100: libblkid-add-support-for-btrfs-backup-superblock.patch
 
 %description
 The util-linux package contains a large variety of low-level system
@@ -724,6 +728,9 @@ fi
 
 
 %changelog
+* Fri Jan 11 2013 Karel Zak <kzak at redhat.com> 2.22.2-2
+- fix #889888 - wipefs does not completely wipe btrfs volume
+
 * Fri Jan 11 2013 Karel Zak <kzak at redhat.com> 2.22.2-1
 - update tarball
 


More information about the scm-commits mailing list