diff --git a/0169-btrfs-progs-udev-add-rules-for-dm-devices.patch b/0169-btrfs-progs-udev-add-rules-for-dm-devices.patch new file mode 100644 index 0000000..557ffd2 --- /dev/null +++ b/0169-btrfs-progs-udev-add-rules-for-dm-devices.patch @@ -0,0 +1,82 @@ +From 8bd39e44efa9fdbf221200b3d680b2d8205c89e9 Mon Sep 17 00:00:00 2001 +From: Jeff Mahoney +Date: Fri, 6 May 2016 15:18:32 -0400 +Subject: [PATCH v2] btrfs-progs: udev: add rules for dm devices +References: bsc#912170 bsc#888215 +Patch-upstream: Submitted to linux-btrfs, 9 May 2016 + +Systemd's btrfs rule runs btrfs dev ready on each device +as it's discovered. The btrfs command is executed as a builtin +command via an IMPORT{builtin} rule, which means it gets +executed at rule evaluation time, not rule execution time. That +means that the device mapper links haven't been setup yet and the only +nodes that can be depended upon are /dev/dm-#. That we see +/dev/mapper/name names in /proc/mounts is only because we replace the +device name we have cached with the one passed in via mount. If +we have a multi-device file system and the primary device is removed, +the remaining devices will show /dev/dm-#. In addition, if the +udev rule is executed again by someone generating a change event (e.g. +partprobe), the names are also replaced by the /dev/dm-# names. + +This patch adds a new rule that adds a run rule that calls btrfs dev +ready again using the device mapper links once they're created. +--- + 64-btrfs-dm.rules | 10 ++++++++++ + Makefile.in | 8 ++++++++ + configure.ac | 2 ++ + 3 files changed, 20 insertions(+) + create mode 100644 64-btrfs-dm.rules + +--- /dev/null ++++ b/64-btrfs-dm.rules +@@ -0,0 +1,10 @@ ++SUBSYSTEM!="block", GOTO="btrfs_end" ++KERNEL!="dm-[0-9]*", GOTO="btrfs_end" ++ACTION!="add|change", GOTO="btrfs_end" ++ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end" ++ ++# Once the device mapper symlink is created, tell btrfs about it ++# so we get the friendly name in /proc/mounts (and tools that read it) ++ENV{DM_NAME}=="?*", RUN{builtin}+="btrfs ready /dev/mapper/$env{DM_NAME}" ++ ++LABEL="btrfs_end" +--- a/Makefile.in ++++ b/Makefile.in +@@ -84,11 +84,15 @@ libbtrfs_headers = send-stream.h send-ut + extent_io.h ioctl.h ctree.h btrfsck.h version.h + TESTS = fsck-tests.sh convert-tests.sh + ++udev_rules = 64-btrfs-dm.rules ++ + prefix ?= @prefix@ + exec_prefix = @exec_prefix@ + bindir = @bindir@ + libdir ?= @libdir@ + incdir = @includedir@/btrfs ++udevdir = @UDEVDIR@ ++udevruledir = ${udevdir}/rules.d + + ifeq ("$(origin V)", "command line") + BUILD_VERBOSE = $(V) +@@ -390,6 +394,10 @@ install: $(libs) $(progs_install) $(INST + cp -a $(lib_links) $(DESTDIR)$(libdir) + $(INSTALL) -m755 -d $(DESTDIR)$(incdir) + $(INSTALL) -m644 $(headers) $(DESTDIR)$(incdir) ++ifneq ($(udevdir),) ++ $(INSTALL) -m755 -d $(DESTDIR)$(udevruledir) ++ $(INSTALL) -m644 $(udev_rules) $(DESTDIR)$(udevruledir) ++endif + + install-static: $(progs_static) $(INSTALLDIRS) + $(INSTALL) -m755 -d $(DESTDIR)$(bindir) +--- a/configure.ac ++++ b/configure.ac +@@ -124,6 +124,8 @@ PKG_STATIC(UUID_LIBS_STATIC, [uuid]) + PKG_CHECK_MODULES(ZLIB, [zlib]) + PKG_STATIC(ZLIB_LIBS_STATIC, [zlib]) + ++PKG_CHECK_VAR([UDEVDIR], [udev], [udevdir]) ++ + dnl lzo library does not provide pkg-config, let use classic way + AC_CHECK_LIB([lzo2], [lzo_version], [ + LZO2_LIBS="-llzo2" diff --git a/btrfs-progs-no-PKG_CHECK_VAR b/btrfs-progs-no-PKG_CHECK_VAR new file mode 100644 index 0000000..710d0b8 --- /dev/null +++ b/btrfs-progs-no-PKG_CHECK_VAR @@ -0,0 +1,29 @@ +From: Jeff Mahoney +Subject: btrfs-progs: make PKG_CHECK_VAR optional +Patch-upstream: Never, SLE11-specific + +SLE11 has an old enough pkg-config that PKG_CHECK_VAR doesn't exist. + +We can skip checking it because SLE11 doesn't have systemd's btrfs udev +rules either and 'make install' does the right thing if UDEVDIR is empty. +--- + + configure.ac | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 4af7474..64b1c7a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -124,7 +124,10 @@ PKG_STATIC(UUID_LIBS_STATIC, [uuid]) + PKG_CHECK_MODULES(ZLIB, [zlib]) + PKG_STATIC(ZLIB_LIBS_STATIC, [zlib]) + +-PKG_CHECK_VAR([UDEVDIR], [udev], [udevdir]) ++UDEVDIR= ++m4_ifdef([PKG_CHECK_VAR], ++[PKG_CHECK_VAR([UDEVDIR], [udev], [udevdir])]) ++AC_SUBST(UDEVDIR) + + dnl lzo library does not provide pkg-config, let use classic way + AC_CHECK_LIB([lzo2], [lzo_version], [ diff --git a/btrfs-progs-v4.5.2.tar.gz b/btrfs-progs-v4.5.2.tar.gz deleted file mode 100644 index 22336a6..0000000 --- a/btrfs-progs-v4.5.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0614424a722bc550c0ebafd3e5aa8a9533d50a12b7c166398e0ce6fecde65405 -size 1447422 diff --git a/btrfs-progs-v4.5.3.tar.gz b/btrfs-progs-v4.5.3.tar.gz new file mode 100644 index 0000000..f4ae574 --- /dev/null +++ b/btrfs-progs-v4.5.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:638aa93aa8c0cd2d56a4b53052dce94e560beda5cd81f9a047d476ae939b9e1b +size 1468692 diff --git a/btrfsprogs.changes b/btrfsprogs.changes index 3cc66f8..abe6a71 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,28 @@ +------------------------------------------------------------------- +Mon May 16 00:00:00 CEST 2016 - dsterba@suse.cz + +- update to 4.5.3 + * ioctl: fix unaligned access in buffer from TREE_SEARCH; might cause SIGBUS + on architectures that do not support unaligned access and do not performa + any fixups + * improved validation checks of superblock and chunk-related structures + * subvolume sync: fix handling of -s option + * balance: adjust timing of safety delay countdown with --full-balance + * rescue super-recover: fix reversed condition check + * check: fix bytes_used accounting + * documentation updates: mount options, scrub, send, receive, select-super, + check, mkfs + * testing: new fuzzed images, for superblock and chunks +- fix build failure on 13.1: conditional default for udevdir +- fix build failure on SLE11SP4: wrong check in makefile + +------------------------------------------------------------------- +Mon May 9 15:47:01 UTC 2016 - jeffm@suse.com + +- Add udev rules for dm devices (bsc#912170 bsc#888215) + - Added patch: 0169-btrfs-progs-udev-add-rules-for-dm-devices.patch + - Added patch: btrfs-progs-no-PKG_CHECK_VAR + ------------------------------------------------------------------- Tue May 3 00:00:00 CEST 2016 - dsterba@suse.cz diff --git a/btrfsprogs.spec b/btrfsprogs.spec index d685eb9..0179cda 100644 --- a/btrfsprogs.spec +++ b/btrfsprogs.spec @@ -24,7 +24,7 @@ %endif Name: btrfsprogs -Version: 4.5.2 +Version: 4.5.3 Release: 0 Summary: Utilities for the Btrfs filesystem License: GPL-2.0 @@ -40,8 +40,10 @@ Source4: setup-btrfs.sh Patch163: 0163-btrfs-progs-fsck-fix-segfault.patch Patch167: 0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch Patch168: 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch +Patch169: 0169-btrfs-progs-udev-add-rules-for-dm-devices.patch Patch1000: local-version-override.patch +Patch1001: btrfs-progs-no-PKG_CHECK_VAR BuildRequires: asciidoc BuildRequires: autoconf @@ -112,7 +114,9 @@ build applications to interface with btrfs. %patch163 -p1 %patch167 -p1 %patch168 -p1 +%patch169 -p1 %patch1000 -p1 +%patch1001 -p1 %build ./autogen.sh @@ -168,6 +172,11 @@ rm -f %{buildroot}/%{_libdir}/*.a install -m 0755 -d %{buildroot}/%{_datadir}/bash-completion/completions install -m 0644 btrfs-completion %{buildroot}/%{_datadir}/bash-completion/completions/btrfs +# 13.1 does not have pkg-config but does have rules +%if 0%{?suse_version} == 1310 +install -m 0755 -d %{buildroot}/usr/lib/udev/rules.d/64-btrfs-dm.rules +%endif + %if 0%{!?for_debugging:1} DEBUG_FILES="/sbin/btrfs-find-root %{_sbindir}/btrfs-find-root @@ -257,6 +266,11 @@ done %dir %{_datadir}/bash-completion/completions %{_datadir}/bash-completion/completions/btrfs +%if 0%{?suse_version} >= 1200 +%dir %{_udevrulesdir} +%{_udevrulesdir}/64-btrfs-dm.rules +%endif + %if 0%{?for_debugging:1} /sbin/btrfs-find-root %{_sbindir}/btrfs-find-root diff --git a/local-version-override.patch b/local-version-override.patch index fb7b570..8dda45f 100644 --- a/local-version-override.patch +++ b/local-version-override.patch @@ -6,8 +6,8 @@ Index: btrfs-progs-v4.1/version.sh # Copyright 2008, Oracle # Released under the GNU GPLv2 --v="v4.5.2" -+v="v4.5.2+20160503" +-v="v4.5.3" ++v="v4.5.3+20160516" opt=$1