From 37074250399f0e085387855dddcbcc35760d05d40b3cde96c31a4ba9c0b3c79e Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Mon, 16 Sep 2013 15:51:02 +0000 Subject: [PATCH 1/3] - update to upstream master (194aa4a1) - btrfs-restore: deal with NULL returns from read_node_slot - btrfs-restore: use the correct leafsize when reading the FS location - btrfs-find-root: Add options to control generation and level - btrfsck: fix incorrect casting on items in the corrupt_blocks tree - Btrfs-progs: fix closing of devices - Btrfs-progs: enhance btrfs-image to restore image onto multiple disks - Btrfs-progs: cleanup btrfs-image usage - Btrfs-progs: delete fs_devices itself from fs_uuid list before freeing - Btrfs-progs: skip open devices which is missing - Btrfs-progs: fix misuse of skinny metadata in btrfs-image - Btrfs-progs: recover raid0/raid10/raid5/raid6 metadata chunk - Btrfs-progs: Add chunk rebuild function for RAID1/SINGLE/DUP - Btrfs-progs: introduce list_{first, next}_entry/list_splice_tail{_init} - Btrfs-progs: Add chunk recover function - using old chunk items - Btrfs-progs: Add block group check funtion - Btrfs-progs: extend the extent cache for the device extent - Btrfs-progs: use rb-tree instead of extent cache tree for fs/file roots - Btrfs-progs: introduce common insert/search/delete functions for rb-tree - Btrfs-progs: cleanup similar code in open_ctree_* and close_ctree - Btrfs-progs: Don't free the devices when close the ctree - Btrfs-progs: don't close the file descriptor 0 when closing a device - Btrfs-progs: fix missing recow roots when making btrfs filesystem - Add fix for passing super_nr while opening ctree OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=140 --- ...ore-passing-of-super_bytenr-to-device-scan | 106 ++++++++++++++++++ btrfs-progs-v0.20-rc1-335-gf00dd83.tar.bz2 | 3 - btrfs-progs-v0.20-rc1-358-g194aa4a.tar.bz2 | 3 + btrfsprogs.changes | 29 +++++ btrfsprogs.spec | 4 +- 5 files changed, 141 insertions(+), 4 deletions(-) create mode 100644 btrfs-progs-restore-passing-of-super_bytenr-to-device-scan delete mode 100644 btrfs-progs-v0.20-rc1-335-gf00dd83.tar.bz2 create mode 100644 btrfs-progs-v0.20-rc1-358-g194aa4a.tar.bz2 diff --git a/btrfs-progs-restore-passing-of-super_bytenr-to-device-scan b/btrfs-progs-restore-passing-of-super_bytenr-to-device-scan new file mode 100644 index 0000000..e4a5eec --- /dev/null +++ b/btrfs-progs-restore-passing-of-super_bytenr-to-device-scan @@ -0,0 +1,106 @@ +From 3a628f64ccdf41671368474a53c093ab03df1f98 Mon Sep 17 00:00:00 2001 +From: Jeff Mahoney +Date: Thu, 15 Aug 2013 20:32:00 -0400 +Subject: btrfs-progs: restore passing of super_bytenr to device scan + +Commit 615f2867 (Btrfs-progs: cleanup similar code in open_ctree_* +and close_ctree) introduced a regression in btrfs-convert. + +open_ctree takes a sb_bytenr argument to specify where to find the +superblock. Under normal conditions, this will be at BTRFS_SUPER_INFO_OFFSET, +and that commit assumed as much under all conditions. + +make_btrfs allows the caller to specify which blocks to use for +certain blocks (including the superblock) and this is used by btrfs-convert +to avoid overwriting the source file system's superblock until the +conversion is complete. + +When btrfs-convert goes to open the newly initialized file system, it +fails with: "No valid btrfs found" since its superblock wasn't written +to the normal location. + +This patch restores the passing down of super_bytesnr to +btrfs_scan_one_device. + +Signed-off-by: Jeff Mahoney +--- + btrfs-find-root.c | 2 +- + cmds-chunk.c | 2 +- + disk-io.c | 10 +++++++--- + disk-io.h | 3 ++- + 4 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/btrfs-find-root.c b/btrfs-find-root.c +index 9b3d7df..374cf81 100644 +--- a/btrfs-find-root.c ++++ b/btrfs-find-root.c +@@ -82,7 +82,7 @@ static struct btrfs_root *open_ctree_broken(int fd, const char *device) + return NULL; + } + +- ret = btrfs_scan_fs_devices(fd, device, &fs_devices); ++ ret = btrfs_scan_fs_devices(fd, device, &fs_devices, 0); + if (ret) + goto out; + +diff --git a/cmds-chunk.c b/cmds-chunk.c +index 03314de..6ada328 100644 +--- a/cmds-chunk.c ++++ b/cmds-chunk.c +@@ -1291,7 +1291,7 @@ static int recover_prepare(struct recover_control *rc, char *path) + goto fail_free_sb; + } + +- ret = btrfs_scan_fs_devices(fd, path, &fs_devices); ++ ret = btrfs_scan_fs_devices(fd, path, &fs_devices, 0); + if (ret) + goto fail_free_sb; + +diff --git a/disk-io.c b/disk-io.c +index 13dbe27..1b91de6 100644 +--- a/disk-io.c ++++ b/disk-io.c +@@ -909,13 +909,17 @@ void btrfs_cleanup_all_caches(struct btrfs_fs_info *fs_info) + } + + int btrfs_scan_fs_devices(int fd, const char *path, +- struct btrfs_fs_devices **fs_devices) ++ struct btrfs_fs_devices **fs_devices, ++ u64 super_bytenr) + { + u64 total_devs; + int ret; + ++ if (super_bytenr == 0) ++ super_bytenr = BTRFS_SUPER_INFO_OFFSET; ++ + ret = btrfs_scan_one_device(fd, path, fs_devices, +- &total_devs, BTRFS_SUPER_INFO_OFFSET); ++ &total_devs, super_bytenr); + if (ret) { + fprintf(stderr, "No valid Btrfs found on %s\n", path); + return ret; +@@ -1001,7 +1005,7 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path, + if (restore) + fs_info->on_restoring = 1; + +- ret = btrfs_scan_fs_devices(fp, path, &fs_devices); ++ ret = btrfs_scan_fs_devices(fp, path, &fs_devices, sb_bytenr); + if (ret) + goto out; + +diff --git a/disk-io.h b/disk-io.h +index effaa9f..d7792e0 100644 +--- a/disk-io.h ++++ b/disk-io.h +@@ -59,7 +59,8 @@ int btrfs_setup_all_roots(struct btrfs_fs_info *fs_info, + void btrfs_release_all_roots(struct btrfs_fs_info *fs_info); + void btrfs_cleanup_all_caches(struct btrfs_fs_info *fs_info); + int btrfs_scan_fs_devices(int fd, const char *path, +- struct btrfs_fs_devices **fs_devices); ++ struct btrfs_fs_devices **fs_devices, ++ u64 super_bytenr); + int btrfs_setup_chunk_tree_and_device_map(struct btrfs_fs_info *fs_info); + + struct btrfs_root *open_ctree(const char *filename, u64 sb_bytenr, int writes); + diff --git a/btrfs-progs-v0.20-rc1-335-gf00dd83.tar.bz2 b/btrfs-progs-v0.20-rc1-335-gf00dd83.tar.bz2 deleted file mode 100644 index 4fc1b89..0000000 --- a/btrfs-progs-v0.20-rc1-335-gf00dd83.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:08e8eafbcc4cdd65eabdfc24e1165e1cb835a63a37f0e0f88af1e48c37d54826 -size 234916 diff --git a/btrfs-progs-v0.20-rc1-358-g194aa4a.tar.bz2 b/btrfs-progs-v0.20-rc1-358-g194aa4a.tar.bz2 new file mode 100644 index 0000000..f7c3bdb --- /dev/null +++ b/btrfs-progs-v0.20-rc1-358-g194aa4a.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:719ec8f8d3018995d39937cc435bfe080d117aff5a1581aa8d547917cedd8eb6 +size 246154 diff --git a/btrfsprogs.changes b/btrfsprogs.changes index 06ac095..de1ed5c 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,32 @@ +------------------------------------------------------------------- +Mon Sep 16 15:49:00 UTC 2013 - jeffm@suse.com + +- update to upstream master (194aa4a1) + - btrfs-restore: deal with NULL returns from read_node_slot + - btrfs-restore: use the correct leafsize when reading the FS location + - btrfs-find-root: Add options to control generation and level + - btrfsck: fix incorrect casting on items in the corrupt_blocks tree + - Btrfs-progs: fix closing of devices + - Btrfs-progs: enhance btrfs-image to restore image onto multiple disks + - Btrfs-progs: cleanup btrfs-image usage + - Btrfs-progs: delete fs_devices itself from fs_uuid list before freeing + - Btrfs-progs: skip open devices which is missing + - Btrfs-progs: fix misuse of skinny metadata in btrfs-image + - Btrfs-progs: recover raid0/raid10/raid5/raid6 metadata chunk + - Btrfs-progs: Add chunk rebuild function for RAID1/SINGLE/DUP + - Btrfs-progs: introduce list_{first, next}_entry/list_splice_tail{_init} + - Btrfs-progs: Add chunk recover function - using old chunk items + - Btrfs-progs: Add block group check funtion + - Btrfs-progs: extend the extent cache for the device extent + - Btrfs-progs: use rb-tree instead of extent cache tree for fs/file roots + - Btrfs-progs: introduce common insert/search/delete functions for rb-tree + - Btrfs-progs: cleanup similar code in open_ctree_* and close_ctree + - Btrfs-progs: Don't free the devices when close the ctree + - Btrfs-progs: don't close the file descriptor 0 when closing a device + - Btrfs-progs: fix missing recow roots when making btrfs filesystem + +- Add fix for passing super_nr while opening ctree + ------------------------------------------------------------------- Thu Sep 5 16:33:50 CEST 2013 - dsterba@suse.cz diff --git a/btrfsprogs.spec b/btrfsprogs.spec index e0e2a65..6ff1472 100644 --- a/btrfsprogs.spec +++ b/btrfsprogs.spec @@ -20,7 +20,7 @@ Name: btrfsprogs Url: http://btrfs.wiki.kernel.org/index.php/Main_Page Version: 0.20 Release: 0 -%define tar_version v0.20-rc1-335-gf00dd83 +%define tar_version v0.20-rc1-358-g194aa4a Summary: Utilities for the Btrfs filesystem License: GPL-2.0 Group: System/Filesystems @@ -39,6 +39,7 @@ Patch1: btrfs-progs-mkfs-default-extref.diff Patch1000: local-version-override.patch Patch1001: btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch Patch1002: btrfs-progs-add-man-page-for-btrfs-convert.patch +Patch1003: btrfs-progs-restore-passing-of-super_bytenr-to-device-scan BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libacl-devel @@ -82,6 +83,7 @@ build applications to interface with btrfs. %patch1000 -p1 %patch1001 -p1 %patch1002 -p1 +%patch1003 -p1 %build make %{?_smp_mflags} CFLAGS="%{optflags}" all btrfs-convert \ From 08211c769b6c5d2563935bcebb6fab0b29b4f59e0f1e77e75e8fed639a119b0f Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Thu, 26 Sep 2013 21:22:32 +0000 Subject: [PATCH 2/3] Accepting request 200992 from home:jeff_mahoney:testpkgs - Remove udev rules file - udev packages one itself (bnc#839960). OBS-URL: https://build.opensuse.org/request/show/200992 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=141 --- 80-btrfs.rules | 20 -------------------- btrfsprogs.changes | 5 +++++ btrfsprogs.spec | 6 ------ 3 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 80-btrfs.rules diff --git a/80-btrfs.rules b/80-btrfs.rules deleted file mode 100644 index b62a13f..0000000 --- a/80-btrfs.rules +++ /dev/null @@ -1,20 +0,0 @@ -SUBSYSTEM!="block", GOTO="btrfs_end" -ACTION!="add|change", GOTO="btrfs_end" - -ENV{ID_FS_TYPE}=="LVM2_member|LVM1_member", GOTO="btrfs_end" -ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="btrfs_end" - -ENV{ID_FS_TYPE}=="btrfs", GOTO="btrfs_do_scan" -ENV{DM_UUID}=="LVM-?*", GOTO="btrfs_do_scan" -ENV{DM_UUID}=="LUKS-CRYPT1-?*", GOTO="btrfs_do_scan" -ENV{DM_UUID}=="LUKS-PLAIN-?*", GOTO="btrfs_do_scan" -ENV{DM_UUID}=="LUKS-VERITY-?*", GOTO="btrfs_do_scan" -ENV{DM_UUID}=="LUKS-LOOPAES-?*", GOTO="btrfs_do_scan" -ENV{MD_UUID}=="?*", GOTO="btrfs_do_scan" -GOTO="btrfs_end" - -LABEL="btrfs_do_scan" -RUN+="/sbin/modprobe btrfs" -RUN+="/usr/sbin/btrfs device scan $env{DEVNAME}" - -LABEL="btrfs_end" diff --git a/btrfsprogs.changes b/btrfsprogs.changes index de1ed5c..3f591fb 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Sep 26 21:21:15 UTC 2013 - jeffm@suse.com + +- Remove udev rules file - udev packages one itself (bnc#839960). + ------------------------------------------------------------------- Mon Sep 16 15:49:00 UTC 2013 - jeffm@suse.com diff --git a/btrfsprogs.spec b/btrfsprogs.spec index 6ff1472..2fcedeb 100644 --- a/btrfsprogs.spec +++ b/btrfsprogs.spec @@ -31,7 +31,6 @@ Source: btrfs-progs-%{tar_version}.tar.bz2 Source1: boot-btrfs.sh Source4: setup-btrfs.sh Source2: btrfs-dev-clear-sb -Source3: 80-btrfs.rules Patch10: 0010-Btrfs-progs-make-btrfsck-a-hardlink-at-install-time.patch Patch12: 0012-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch Patch40: 0040-btrfs-progs-fix-loop-device-mount-checks.patch @@ -126,8 +125,6 @@ install -d -m0755 ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/ install -m 0755 %{S:1} ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/ install -m 0755 %{S:4} ${RPM_BUILD_ROOT}/lib/mkinitrd/scripts/ install -m 0755 %{S:2} ${RPM_BUILD_ROOT}/usr/sbin/ -install -d -m 0755 $RPM_BUILD_ROOT/usr/lib/udev/rules.d -install -m 0644 %{S:3} $RPM_BUILD_ROOT/usr/lib/udev/rules.d rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.la # don't install .a for now rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.a @@ -176,9 +173,6 @@ rm -f ${RPM_BUILD_ROOT}/%{_libdir}/*.a %_mandir/man8/mkfs.btrfs.8.gz %_mandir/man8/btrfs.8.gz %_mandir/man8/btrfs-convert.8.gz -%dir /usr/lib/udev/ -%dir /usr/lib/udev/rules.d/ -/usr/lib/udev/rules.d/80-btrfs.rules %files -n libbtrfs0 %defattr(-, root, root) From 3ba375bc14c092ddc2672ac17ba09d3eb05aa8e7d21be0f9f1286737e51a2e9c Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 9 Oct 2013 13:15:02 +0000 Subject: [PATCH 3/3] Accepting request 202291 from home:goldwynr:branches:filesystems bnc#839960 comment #7 fix mkinitrd script btrfs.sh OBS-URL: https://build.opensuse.org/request/show/202291 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=142 --- btrfsprogs.changes | 7 +++++++ setup-btrfs.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/btrfsprogs.changes b/btrfsprogs.changes index 3f591fb..e9706d0 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Oct 4 20:16:02 UTC 2013 - rgoldwyn@suse.com + +- Change udev rule filename in setup-btrfs.sh to + /usr/lib/udev/rules.d/64-btrfs.rules from + from /usr/lib/udev/rules.d/80-btrfs.rules (bnc#839960 comment#7) + ------------------------------------------------------------------- Thu Sep 26 21:21:15 UTC 2013 - jeffm@suse.com diff --git a/setup-btrfs.sh b/setup-btrfs.sh index 5491982..8cbe45c 100644 --- a/setup-btrfs.sh +++ b/setup-btrfs.sh @@ -3,4 +3,4 @@ #%stage: filesystem mkdir -p $tmp_mnt/etc/udev/rules.d -cp /usr/lib/udev/rules.d/80-btrfs.rules $tmp_mnt/etc/udev/rules.d +cp /usr/lib/udev/rules.d/64-btrfs.rules $tmp_mnt/etc/udev/rules.d