Hello community, here is the log from the commit of package device-mapper for openSUSE:Factory checked in at 2013-08-30 11:35:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/device-mapper (Old) and /work/SRC/openSUSE:Factory/.device-mapper.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "device-mapper" Changes: -------- New Changes file: --- /dev/null 2013-07-23 23:44:04.804033756 +0200 +++ /work/SRC/openSUSE:Factory/.device-mapper.new/device-mapper.changes 2013-08-30 11:35:52.000000000 +0200 @@ -0,0 +1,615 @@ +------------------------------------------------------------------- +Wed Aug 28 11:17:12 UTC 2013 - [email protected] + +- replace buildrequires systemd by pkgconfig(udev), use + systemd rpm macro for rules dir. + +------------------------------------------------------------------- +Mon Aug 26 11:33:49 UTC 2013 - [email protected] + +- add gpg signature file, use source urls + +------------------------------------------------------------------- +Tue Aug 6 07:57:44 UTC 2013 - [email protected] + +- remove boot.device-mapper, add systemd support + add thin provision tools support + +------------------------------------------------------------------- +Wed Feb 20 00:41:45 UTC 2013 - [email protected] + +- mkinitrd-devmapper-setup.sh: special case handling + for "dm-thin" and table is called "thin" but module + is "dm-thin-pool" (BNC#803955) + +------------------------------------------------------------------- +Mon Feb 18 03:18:06 UTC 2013 - [email protected] + +- bnc#730837, LVM tools fail with segfault when /etc/lvm/.cache + file is truncated + +------------------------------------------------------------------- +Wed Dec 5 22:12:42 UTC 2012 - [email protected] + +- add thin-provisioning-tools (FATE#313904) + +------------------------------------------------------------------- +Tue Dec 4 03:28:53 UTC 2012 - [email protected] + +- Update to latest upstream version LVM2.2.02.98 + to gain dm-thin support. (FATE#313904). + +------------------------------------------------------------------- +Thu Jul 19 04:50:33 UTC 2012 - [email protected] + +- bnc#766187, lvremove fails on deleting snapshot volume, + wait more time if has open_count +- bnc#770200: Online Update to SP2 with kernel 3.0.34-0.7-default + cause LVM to report memory leak, run mkinitrd when update package + +------------------------------------------------------------------- +Fri Feb 3 11:18:07 UTC 2012 - [email protected] + +- Install 12-dm-permissions.rules as a doc file, instead of + /lib/udev/rules.d/ . This file is meant as a template, to be + customized and copied to /etc/udev/rules.d . Remove earlier, + now redundant, patch for the same file. (bnc#743797). + +------------------------------------------------------------------- +Wed Dec 7 11:57:04 CET 2011 - [email protected] + +- make building libdevmapper-event in both versions a little + more robust (we ended up without the 1.03 libs in 10% of the + build tries) + +------------------------------------------------------------------- +Fri Dec 2 14:52:35 UTC 2011 - [email protected] + +- install 12-dm-permissions.rules file. + bnc#728897. + +------------------------------------------------------------------- +Tue Nov 1 09:53:27 UTC 2011 - [email protected] + +- bnc#512988, require dm-mirror if root on dm. + +------------------------------------------------------------------- +Mon Oct 24 06:05:36 UTC 2011 - [email protected] + +- bnc#719424. Packages depend on libdevmapper want to differentiate + the libraries with udev support or without. + So, the package now provides both 1.02 and 1.03 libraries. The + 1.02 library will be dropped once upstream bump up the version + number officially. + +------------------------------------------------------------------- +Wed Oct 19 23:20:12 UTC 2011 - [email protected] + +- device-mapper-link: Make sure /dev/device-mapper + gets created as a link to /dev/mapper/control. + This is needed for compatibility with SP1 and earlier. + bnc#724578 + +------------------------------------------------------------------- +Wed Aug 17 09:10:08 CEST 2011 - [email protected] + +- add baselibs.conf to sources + +------------------------------------------------------------------- +Mon Jul 25 09:13:21 UTC 2011 - [email protected] + +- bnc#707253, 'dmsetup export' failure cause the problem with udev + rules. + +------------------------------------------------------------------- +Tue Jun 28 04:27:37 UTC 2011 - [email protected] + +- enable the udev rules for device-mapper to create device file +- enable the udev rules for sync operation + +------------------------------------------------------------------- +Mon Jun 13 06:04:57 UTC 2011 - [email protected] + +- update to 1.02.63 as per requested by fate#312090 + Fix segfault when getopt processes dmsetup -U, -G and -M options. + Add libdevmapper functions to support synchronisation with udev. + +------------------------------------------------------------------- +Thu Apr 14 08:49:17 UTC 2011 - [email protected] + +- bnc#638424, make the "waiting for deactivation" less verbose + +------------------------------------------------------------------- +Fri Dec 3 10:09:53 UTC 2010 - [email protected] + +- bnc#628272, avoiding wait for info only command + +------------------------------------------------------------------- +Wed Mar 3 13:05:17 UTC 2010 - [email protected] + +- bnc#582168, update again as cmirrord updated + +------------------------------------------------------------------- +Wed Feb 24 11:24:02 UTC 2010 - [email protected] + +- bnc#582168, lvcreate fails to create clustered mirror lv + +------------------------------------------------------------------- +Wed Jan 6 07:42:58 CET 2010 - [email protected] + +- bnc#550363, memory access error in hash +- bnc#557775, wait before deactivate +- add support for userspace log (required by cmirrord) + +------------------------------------------------------------------- +Wed Oct 28 06:59:33 UTC 2009 - [email protected] + +- fate#306518, LVM mirror resize back port + +------------------------------------------------------------------- +Tue Apr 21 10:11:35 CEST 2009 - [email protected] + +- bnc#479104, export additional information + +------------------------------------------------------------------- +Tue Feb 3 08:42:58 CET 2009 - [email protected] + +- No whitespace for DM_STATE export variable (bnc#440959) +- Remove obsolete reference to boot.scsidev from init script + +------------------------------------------------------------------- +Wed Dec 10 12:34:56 CET 2008 - [email protected] + +- use Obsoletes: -XXbit only for ppc64 to help solver during distupgrade + (bnc#437293) + +------------------------------------------------------------------- +Wed Nov 5 16:57:47 CET 2008 - [email protected] + +- As boot.crypto depends on boot.device-mapper, the later one has + even on shutdown to depend on boot.udev to make sure that events + will be processed (bnc#413059) + +------------------------------------------------------------------- +Thu Oct 30 12:34:56 CET 2008 - [email protected] + +- obsolete old -XXbit packages (bnc#437293) + +------------------------------------------------------------------- +Sat Sep 13 07:03:44 CEST 2008 - [email protected] + +- Fix typo for correct compiling +- Timeout if udevd's not running (bnc#425436) + +------------------------------------------------------------------- +Wed Sep 10 11:56:17 CEST 2008 - [email protected] + +- update to 1.02.27 + Align struct memblock in dbg_malloc for sparc. + Add --unquoted and --rows to dmsetup. + Avoid compiler warning about cast in dmsetup.c's OFFSET_OF macro. + Fix inverted no_flush debug message. + Remove --enable-jobs from configure. (Set at runtime instead.) + Bring configure.in and list.h into line with the lvm2 versions. + +------------------------------------------------------------------- +Wed Sep 3 11:09:34 CEST 2008 - [email protected] + ++++ 418 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:Factory/.device-mapper.new/device-mapper.changes New: ---- LVM2.2.02.98.tgz LVM2.2.02.98.tgz.asc baselibs.conf boot.device-mapper bug-479104_device-mapper-dmsetup-deps-export.patch device-mapper-dmsetup-export.patch device-mapper-gcc-warnings.patch device-mapper-link device-mapper-static.patch device-mapper.changes device-mapper.spec increase-minor-version.diff mkinitrd-devmapper-boot.sh mkinitrd-devmapper-setup.sh segault_for_truncated_string_token.patch thin-provisioning-tools-v0.2.4.tar.gz udev-rules_update.diff udev_sync-cookie_set-1-on-each-dm_task_set_cookie-ca.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ device-mapper.spec ++++++ # # spec file for package device-mapper # # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: device-mapper # bug437293 %ifarch ppc64 Obsoletes: device-mapper-64bit %endif # Version: 1.02.78 Release: 0.<RELEASE11> Summary: Device Mapper Tools License: GPL-2.0+ and LGPL-2.1+ Group: System/Base Source: ftp://sources.redhat.com/pub/lvm2/LVM2.2.02.98.tgz Source42: ftp://sources.redhat.com/pub/lvm2/LVM2.2.02.98.tgz.asc Source2: mkinitrd-devmapper-setup.sh Source3: mkinitrd-devmapper-boot.sh Source50: thin-provisioning-tools-v0.2.4.tar.gz Source99: baselibs.conf Patch1: %{name}-dmsetup-export.patch Patch2: %{name}-gcc-warnings.patch Patch3: %{name}-static.patch Patch6: bug-479104_device-mapper-dmsetup-deps-export.patch Patch10: device-mapper-link Patch11: increase-minor-version.diff #bnc730837, fixed in upstream Patch12: segault_for_truncated_string_token.patch #sr#140943 #bnc#78902,bnc#789019,bnc#789020 Patch13: udev-rules_update.diff #bnc#788882 Patch14: udev_sync-cookie_set-1-on-each-dm_task_set_cookie-ca.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: boost-devel BuildRequires: gcc-c++ BuildRequires: libexpat-devel BuildRequires: libselinux-devel BuildRequires: libstdc++-devel BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(udev) Requires: expat PreReq: %insserv_prereq %fillup_prereq %{systemd_requires} %description Programs, libraries, and man pages for configuring and using the device mapper. Authors: -------- Joe Thornber <[email protected]> %package devel Summary: Development package for the device mapper Group: System/Base Requires: %name = %version %description devel Files needed for software development using the device mapper Authors: -------- Joe Thornber <[email protected]> %prep %setup -n LVM2.2.02.98 -a50 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch6 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %build export CFLAGS="$RPM_OPT_FLAGS" %configure --bindir=/bin --libdir=/%_lib --sbindir=/sbin --enable-dmeventd \ --enable-selinux --enable-cmdlib \ --with-dmeventd-path=/sbin/dmeventd \ --with-device-uid=0 --with-device-gid=6 --with-device-mode=0640 \ --enable-udev_sync --enable-udev_rules --with-udev-prefix=/usr/ \ --enable-pkgconfig --enable-realtime --with-thin=internal \ --with-thin-check=/sbin/thin_check export SUSE_ASNEEDED=0 make -j1 device-mapper # symlinks are generated in parallel! %{?_smp_mflags} sed s/1.03.01/%{version}/g < VERSION_DM > VERSION_DM.new mv VERSION_DM.new VERSION_DM rm -f libdm/ioctl/libdevmapper.so daemons/dmeventd/libdevmapper-event.so make -j1 device-mapper pushd thin-provisioning-tools-0.2.4 %configure --sbindir=/sbin --with-optimisation=-O2 --prefix=/usr make popd %install make install_device-mapper DESTDIR=$RPM_BUILD_ROOT sed s/%{version}/1.03.01/g < VERSION_DM > VERSION_DM.new mv VERSION_DM.new VERSION_DM rm -f libdm/ioctl/libdevmapper.so daemons/dmeventd/libdevmapper-event.so make -j1 device-mapper make install_device-mapper DESTDIR=$RPM_BUILD_ROOT #make libdir=$RPM_BUILD_ROOT/%_libdir install_static_lib mkdir -p $RPM_BUILD_ROOT/%_libdir mkdir -p $RPM_BUILD_ROOT/%_libdir/pkgconfig mkdir -p $RPM_BUILD_ROOT/etc/init.d #install -m 744 %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d install -d $RPM_BUILD_ROOT%{_unitdir} install scripts/dm_event_systemd_red_hat.socket $RPM_BUILD_ROOT%{_unitdir}/dm-event.socket install scripts/dm_event_systemd_red_hat.service $RPM_BUILD_ROOT%{_unitdir}/dm-event.service install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-dm.sh install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-dm.sh [ %_libdir != "/usr/lib" ] && mv $RPM_BUILD_ROOT/usr/lib/libdevmapper.so $RPM_BUILD_ROOT/%_libdir/libdevmapper.so [ %_libdir != "/usr/lib" ] && mv $RPM_BUILD_ROOT/usr/lib/libdevmapper-event.so $RPM_BUILD_ROOT/%_libdir/libdevmapper-event.so [ %_libdir != "/usr/lib" ] && mv $RPM_BUILD_ROOT/usr/lib/libdevmapper.a $RPM_BUILD_ROOT/%_libdir/libdevmapper.a [ %_libdir != "/usr/lib" ] && mv $RPM_BUILD_ROOT/usr/lib/pkgconfig/devmapper.pc $RPM_BUILD_ROOT/%_libdir/pkgconfig/devmapper.pc [ %_libdir != "/usr/lib" ] && mv $RPM_BUILD_ROOT/usr/lib/pkgconfig/devmapper-event.pc $RPM_BUILD_ROOT/%_libdir/pkgconfig/devmapper-event.pc pushd thin-provisioning-tools-0.2.4 make install DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} popd %post [ -x /sbin/mkinitrd ] && /sbin/mkinitrd %service_add_post dm-event.socket /sbin/ldconfig %preun %service_del_preun dm-event.service dm-event.socket %postun [ -x /sbin/mkinitrd ] && /sbin/mkinitrd /sbin/ldconfig %files %defattr(-,root,root) %doc INSTALL COPYING COPYING.LIB README %doc udev/12-dm-permissions.rules /%_lib/libdevmapper.so.1.02 /%_lib/libdevmapper.so.1.03 /%_lib/libdevmapper-event.so.1.02 /%_lib/libdevmapper-event.so.1.03 /sbin/dmsetup /sbin/dmeventd /usr/sbin/thin_check /usr/sbin/thin_dump /usr/sbin/thin_restore /usr/sbin/thin_metadata_size /usr/sbin/thin_repair /usr/sbin/thin_rmap %{_mandir}/man8/dmsetup.8.gz %{_mandir}/man8/dmeventd.8.gz %{_mandir}/man8/thin_check.8.gz %{_mandir}/man8/thin_dump.8.gz %{_mandir}/man8/thin_restore.8.gz %{_mandir}/man8/thin_metadata_size.8.gz %{_mandir}/man8/thin_repair.8.gz %{_mandir}/man8/thin_rmap.8.gz %dir /lib/mkinitrd %dir /lib/mkinitrd/scripts /lib/mkinitrd/scripts/setup-dm.sh /lib/mkinitrd/scripts/boot-dm.sh %{_udevrulesdir}/10-dm.rules %{_udevrulesdir}/13-dm-disk.rules %{_udevrulesdir}/95-dm-notify.rules %{_unitdir}/dm-event.socket %{_unitdir}/dm-event.service %files devel %defattr(-,root,root) /%_libdir/libdevmapper.so /%_libdir/libdevmapper-event.so %attr(644, root, root) %_libdir/libdevmapper.a /usr/include/libdevmapper.h /usr/include/libdevmapper-event.h /%_libdir/pkgconfig/devmapper-event.pc /%_libdir/pkgconfig/devmapper.pc %changelog ++++++ baselibs.conf ++++++ device-mapper ++++++ boot.device-mapper ++++++ #! /bin/sh # # Copyright (c) 2001 SuSE GmbH Nuernberg, Germany. All rights reserved. # # /etc/init.d/boot.device-mapper # ### BEGIN INIT INFO # Provides: boot.device-mapper # Required-Start: boot.udev boot.rootfsck # Required-Stop: boot.udev # Default-Start: B # Default-Stop: # Description: activate device mapper ### END INIT INFO . /etc/rc.status rc_reset case "$1" in start) echo "Activating device mapper..." lsmod | grep "^dm[-_]mod[ ]" >/dev/null 2>&1 || modprobe dm-mod rc_status -v -r ;; stop) # module unloading seems to be uneliable in kernel 2.6 # rmmod dm-mod # rc_status -v ;; status) rc_failed 4 rc_status -v ;; *) echo "Usage: $0 {start|stop|status}" exit 1 ;; esac rc_exit ++++++ bug-479104_device-mapper-dmsetup-deps-export.patch ++++++ --- tools/dmsetup.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) --- LVM2.2.02.98.orig/tools/dmsetup.c +++ LVM2.2.02.98/tools/dmsetup.c @@ -1717,13 +1717,16 @@ static int _export(CMD_ARGS) char *target_type = NULL; char *params; const char *name = NULL; + const char *old_name = NULL; const char *uuid = NULL; struct dm_info info; + struct dm_deps *deps; if (names) name = names->name; else if (argc == 2) name = argv[1]; + old_name = name; if (!(dmt = dm_task_create(DM_DEVICE_STATUS))) goto out; @@ -1788,6 +1791,25 @@ static int _export(CMD_ARGS) printf("\n"); } + dm_task_destroy(dmt); + + // bnc#707614, revert to the original name + + if (!(dmt = dm_task_create(DM_DEVICE_DEPS))) + goto out; + + name = old_name; + if (!_set_task_device(dmt, name, 0)) + goto out; + + if (!dm_task_run(dmt)) + goto out; + + if (!(deps = dm_task_get_deps(dmt))) + goto out; + + printf("DM_DEPS=%d\n", deps->count); + r = 1; out: if (dmt) ++++++ device-mapper-dmsetup-export.patch ++++++ --- man/dmsetup.8.in | 7 ++++ tools/dmsetup.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) --- LVM2.2.02.98.orig/man/dmsetup.8.in +++ LVM2.2.02.98/man/dmsetup.8.in @@ -43,6 +43,9 @@ dmsetup \- low level logical volume mana .RI [ device_name ] .RE .br +.B dmsetup export +.I [device_name] +.br .B dmsetup load .I device_name .RB [ \-\-table @@ -285,6 +288,10 @@ device_name in subsequent dmsetup comman If successful a device will appear as /dev/mapper/<device-name>. See below for information on the table format. +.IP \fBexport +.I [device_name] +.br +Outputs information in key/value format to be imported by other programs. .br .TP .B deps --- LVM2.2.02.98.orig/tools/dmsetup.c +++ LVM2.2.02.98/tools/dmsetup.c @@ -1708,6 +1708,93 @@ static int _status(CMD_ARGS) return r; } +static int _export(CMD_ARGS) +{ + int r = 0; + struct dm_task *dmt = NULL; + void *next = NULL; + uint64_t start, length; + char *target_type = NULL; + char *params; + const char *name = NULL; + const char *uuid = NULL; + struct dm_info info; + + if (names) + name = names->name; + else if (argc == 2) + name = argv[1]; + + if (!(dmt = dm_task_create(DM_DEVICE_STATUS))) + goto out; + + if (!_set_task_device(dmt, name, 0)) + goto out; + + if (!dm_task_run(dmt)) + goto out; + + if (!dm_task_get_info(dmt, &info) || !info.exists) + goto out; + + if (!name) + name = dm_task_get_name(dmt); + + uuid = dm_task_get_uuid(dmt); + printf("DM_NAME=%s\n", name); + + if ((uuid = dm_task_get_uuid(dmt)) && *uuid) + printf("DM_UUID=%s\n", uuid); + + if (!info.exists) { + printf("DM_STATE=NOTPRESENT\n"); + goto out; + } + + printf("DM_STATE=%s\n", + info.suspended ? "SUSPENDED" : + (info.read_only ? "READONLY" : "ACTIVE")); + + if (!info.live_table && !info.inactive_table) + printf("DM_TABLE_STATE=NONE\n"); + else + printf("DM_TABLE_STATE=%s%s%s\n", + info.live_table ? "LIVE" : "", + info.live_table && info.inactive_table ? "/" : "", + info.inactive_table ? "INACTIVE" : ""); + + if (info.open_count != -1) + printf("DM_OPENCOUNT=%d\n", info.open_count); + + printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr); + + printf("DM_MAJOR=%d\n", info.major); + printf("DM_MINOR=%d\n", info.minor); + + if (info.target_count != -1) + printf("DM_TARGET_COUNT=%d\n", info.target_count); + + /* export all table types */ + next = dm_get_next_target(dmt, next, &start, &length, + &target_type, ¶ms); + if (target_type) { + printf("DM_TARGET_TYPES=%s", target_type); + while (next) { + next = dm_get_next_target(dmt, next, &start, &length, + &target_type, ¶ms); + if (target_type) + printf(",%s", target_type); + } + printf("\n"); + } + + r = 1; + out: + if (dmt) + dm_task_destroy(dmt); + return r; +} + /* Show target names and their version numbers */ static int _targets(CMD_ARGS) { @@ -3058,6 +3146,7 @@ static struct command _commands[] = { {"info", "[<device>]", 0, -1, 1, _info}, {"deps", "[-o options] [<device>]", 0, -1, 1, _deps}, {"status", "[<device>] [--noflush] [--target <target_type>]", 0, -1, 1, _status}, + {"export", "[<device>]", 0, -1, 1, _export}, {"table", "[<device>] [--target <target_type>] [--showkeys]", 0, -1, 1, _status}, {"wait", "<device> [<event_nr>] [--noflush]", 0, 2, 0, _wait}, {"mknodes", "[<device>]", 0, -1, 1, _mknodes}, ++++++ device-mapper-gcc-warnings.patch ++++++ --- libdm/datastruct/hash.c | 6 +++--- libdm/ioctl/libdm-iface.c | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) --- LVM2.2.02.98.orig/libdm/datastruct/hash.c +++ LVM2.2.02.98/libdm/datastruct/hash.c @@ -19,7 +19,7 @@ struct dm_hash_node { struct dm_hash_node *next; void *data; unsigned keylen; - char key[0]; + unsigned char key[0]; }; struct dm_hash_table { @@ -136,7 +136,7 @@ void dm_hash_destroy(struct dm_hash_tabl static struct dm_hash_node **_find(struct dm_hash_table *t, const void *key, uint32_t len) { - unsigned h = _hash(key, len) & (t->num_slots - 1); + unsigned h = _hash((unsigned char *)key, len) & (t->num_slots - 1); struct dm_hash_node **c; for (c = &t->slots[h]; *c; c = &((*c)->next)) { @@ -235,7 +235,7 @@ void dm_hash_wipe(struct dm_hash_table * char *dm_hash_get_key(struct dm_hash_table *t __attribute__((unused)), struct dm_hash_node *n) { - return n->key; + return (char *)n->key; } void *dm_hash_get_data(struct dm_hash_table *t __attribute__((unused)), --- LVM2.2.02.98.orig/libdm/ioctl/libdm-iface.c +++ LVM2.2.02.98/libdm/ioctl/libdm-iface.c @@ -1720,7 +1720,8 @@ static struct dm_ioctl *_do_dm_ioctl(str dmt->secure_data ? "W " : "", dmt->query_inactive_table ? "I " : "", dmt->enable_checks ? "C" : "", - dmt->sector, _sanitise_message(dmt->message), + (unsigned long long int)dmt->sector, + _sanitise_message(dmt->message), dmi->data_size, retry_repeat_count); #ifdef DM_IOCTLS if (ioctl(_control_fd, command, dmi) < 0 && ++++++ device-mapper-link ++++++ Make sure /dev/device-mapper exists as a link to /dev/mapper/control Resolves: bnc#724578 Signed-off-by: NeilBrown <[email protected]> --- udev/10-dm.rules.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- LVM2.2.02.84.orig/udev/10-dm.rules.in +++ LVM2.2.02.84/udev/10-dm.rules.in @@ -14,7 +14,7 @@ # DM_SUSPENDED - suspended state of DM device (0 or 1) # DM_UDEV_RULES_VSN - DM udev rules version -KERNEL=="device-mapper", NAME="(DM_DIR)/control" +KERNEL=="device-mapper", NAME="(DM_DIR)/control", SYMLINK+="device-mapper" SUBSYSTEM!="block", GOTO="dm_end" KERNEL!="dm-[0-9]*", GOTO="dm_end" ++++++ device-mapper-static.patch ++++++ --- libdm/Makefile.in | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- LVM2.2.02.98.orig/libdm/Makefile.in +++ LVM2.2.02.98/libdm/Makefile.in @@ -38,9 +38,7 @@ ifeq ("@VALGRIND_POOL@", "yes") INCLUDES += @VALGRIND_CFLAGS@ endif -ifeq ("@STATIC_LINK@", "yes") LIB_STATIC = $(interface)/libdevmapper.a -endif LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX) LIB_VERSION = $(LIB_VERSION_DM) @@ -70,9 +68,7 @@ libdevmapper.$(LIB_SUFFIX) libdevmapper. INSTALL_TYPE = install_dynamic -ifeq ("@STATIC_LINK@", "yes") - INSTALL_TYPE += install_static -endif +INSTALL_TYPE += install_static ifeq ("@PKGCONFIG@", "yes") INSTALL_TYPE += install_pkgconfig ++++++ increase-minor-version.diff ++++++ Index: LVM2.2.02.84/VERSION_DM =================================================================== --- LVM2.2.02.84.orig/VERSION_DM 2011-02-09 20:07:16.000000000 +0800 +++ LVM2.2.02.84/VERSION_DM 2011-10-24 13:34:18.000000000 +0800 @@ -1,1 +1,1 @@ -1.02.77 (2012-10-15) +1.03.01 (2011-10-15) ++++++ mkinitrd-devmapper-boot.sh ++++++ #!/bin/bash #%stage: boot #%depends: start #%modules: $dm_modules dm-mod dm-snapshot #%programs: /sbin/dmsetup /sbin/blockdev # dm-crypt dm-zero dm-mirror #%if: -n "$root_dm" # ##### Device Mapper ## ## If the root device uses device mapper, this initializes and waits for the control file ## ## Command line parameters ## ----------------------- ## ## root_dm=1 use device mapper ## load_modules # because we run before udev we need to create the device node manually mkdir -p /dev/mapper if [ ! -c /dev/mapper/control ] ; then mknod /dev/mapper/control c 10 63 fi ++++++ mkinitrd-devmapper-setup.sh ++++++ #!/bin/bash # #%stage: devicemapper #%depends: dmroot # # no dmsetup -> no dm if [ -x "$(type -p dmsetup)" ]; then dm_blockdev= # if any device before was on dm we have to activate it [ "$tmp_root_dm" ] && root_dm=1 blockdev="$(dm_resolvedeps_recursive $blockdev)" [ "$?" = 0 ] && root_dm=1 # include dm when using dm based block devs [ "$DM_BLOCK" ] && root_dm=1 # include modules if [ -n "$root_dm" ] ; then # Add all dm modules dm_modules= for table in $(dmsetup table | cut -f 4 -d ' ' | sort | uniq); do if [ "$table" = "thin" ]; then table="thin-pool"; fi if [ "$table" ] && [ "$table" != "linear" ] && [ "$table" != "striped" ] ; then dm_modules="$dm_modules dm-$table" fi done dm_modules="$dm_modules dm-mirror" fi # include dm block var from sysconfig mkdir -p $tmp_mnt/etc/sysconfig grep DM_BLOCK /etc/sysconfig/kernel > $tmp_mnt/etc/sysconfig/kernel mkdir -p $tmp_mnt/usr/lib/udev/rules.d cp /usr/lib/udev/rules.d/10-dm.rules $tmp_mnt/usr/lib/udev/rules.d/ cp /usr/lib/udev/rules.d/13-dm-disk.rules $tmp_mnt/usr/lib/udev/rules.d cp /usr/lib/udev/rules.d/95-dm-notify.rules $tmp_mnt/usr/lib/udev/rules.d save_var root_dm save_var dm_modules fi ++++++ segault_for_truncated_string_token.patch ++++++ commit 4f439707fd4a8837f930c14076bc662ca5c19844 Author: Zdenek Kabelac <[email protected]> Date: Fri Feb 1 11:07:44 2013 +0100 libdm: fix segault for truncated string token. This patch fixes problem reported here: https://www.redhat.com/archives/dm-devel/2013-January/msg00311.html Fixing it by separating function for duplicating string token. --- When /etc/lvm/lvm.conf is truncated at the first '"' of a line, all LVM utilities crash with a segfault. The segfault only seems to occur if the last character is the first '"' (double quote) of a line. If you truncate it at any other point, lvm detects the error and report parse error lvm.conf ends like this. $hexdump -C lvm.conf .... 69 72 20 3d 20 22 2f 64 65 76 22 0a 0a 0a 20 20 |ir = "/dev"... | 20 20 23 20 41 6e 20 61 72 72 61 79 20 6f 66 20 | # An array of | 64 69 72 65 63 74 6f 72 69 65 73 20 74 68 61 74 |directories that| 20 63 6f 6e 74 61 69 6e 20 74 68 65 20 64 65 76 | contain the dev| 69 63 65 20 6e 6f 64 65 73 20 79 6f 75 20 77 69 |ice nodes you wi| 73 68 0a 20 20 20 20 23 20 74 6f 20 75 73 65 20 |sh. # to use | 77 69 74 68 20 4c 56 4d 32 2e 0a 20 20 20 20 73 |with LVM2.. s| 63 61 6e 20 3d 20 5b 20 22 2f 78 22 2c 0a 20 20 |can = [ "/x",. | 20 20 20 20 20 20 20 20 20 20 20 22 | "| ... Reported-by: dongmao zhang <dmzhang suse com> Index: LVM2.2.02.98/libdm/libdm-config.c =================================================================== --- LVM2.2.02.98.orig/libdm/libdm-config.c +++ LVM2.2.02.98/libdm/libdm-config.c @@ -360,6 +360,27 @@ int dm_config_write_node(const struct dm /* * parser */ +static char *_dup_string_tok(struct parser *p) +{ + char *str; + + p->tb++, p->te--; /* strip "'s */ + + if (p->te < p->tb) { + log_error("Parse error at byte %" PRIptrdiff_t " (line %d): " + "expected a string token.", + p->tb - p->fb + 1, p->line); + return NULL; + } + + if (!(str = _dup_tok(p))) + return_NULL; + + p->te++; + + return str; +} + static struct dm_config_node *_file(struct parser *p) { struct dm_config_node *root = NULL, *n, *l = NULL; @@ -480,22 +501,19 @@ static struct dm_config_value *_type(str case TOK_STRING: v->type = DM_CFG_STRING; - p->tb++, p->te--; /* strip "'s */ - if (!(v->v.str = _dup_tok(p))) + if (!(v->v.str = _dup_string_tok(p))) return_NULL; - p->te++; + match(TOK_STRING); break; case TOK_STRING_ESCAPED: v->type = DM_CFG_STRING; - p->tb++, p->te--; /* strip "'s */ - if (!(str = _dup_tok(p))) + if (!(str = _dup_string_tok(p))) return_NULL; dm_unescape_double_quotes(str); v->v.str = str; - p->te++; match(TOK_STRING_ESCAPED); break; ++++++ udev-rules_update.diff ++++++ --- udev/10-dm.rules.in | 4 ++++ udev/13-dm-disk.rules.in | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) Index: LVM2.2.02.98/udev/10-dm.rules.in =================================================================== --- LVM2.2.02.98.orig/udev/10-dm.rules.in +++ LVM2.2.02.98/udev/10-dm.rules.in @@ -88,10 +88,14 @@ ACTION=="add", ENV{DM_UDEV_RULES_VSN}!=" # is in between these releases. TEST=="dm", ENV{DM_NAME}="$attr{dm/name}", ENV{DM_UUID}="$attr{dm/uuid}", ENV{DM_SUSPENDED}="$attr{dm/suspended}" TEST!="dm", IMPORT{program}="(DM_EXEC)/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o name,uuid,suspended" ENV{DM_SUSPENDED}!="?*", IMPORT{program}="(DM_EXEC)/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o suspended" +# dmsetup export is a SUSE extension to dmsetup +# it is required by some other udev rules in SUSE distro. +IMPORT{program}="(DM_EXEC)/dmsetup export -j %M -m %m" + # dmsetup tool provides suspended state information in textual # form with values "Suspended"/"Active". We translate it to # 0/1 respectively to be consistent with sysfs values. ENV{DM_SUSPENDED}=="Active", ENV{DM_SUSPENDED}="0" ENV{DM_SUSPENDED}=="Suspended", ENV{DM_SUSPENDED}="1" Index: LVM2.2.02.98/udev/13-dm-disk.rules.in =================================================================== --- LVM2.2.02.98.orig/udev/13-dm-disk.rules.in +++ LVM2.2.02.98/udev/13-dm-disk.rules.in @@ -12,17 +12,20 @@ # "add" event is processed on coldplug only! ACTION!="add|change", GOTO="dm_end" ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end" ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end" -SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" -ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" +SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}", OPTIONS+="string_escape=replace" +ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}", OPTIONS+="string_escape=replace" ENV{DM_SUSPENDED}=="1", GOTO="dm_end" +ENV{DM_TARGET_TYPES}=="|*error*", GOTO="dm_end" (BLKID_RULE) -ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100" +ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS+="link_priority=-100" +OPTIONS+="watch" +ENV{DM_TARGET_TYPES}=="*snapshot-origin*", OPTIONS+="link_priority=-90" ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" # Add inotify watch to track changes on this device. # Using the watch rule is not optimal - it generates a lot of spurious ++++++ udev_sync-cookie_set-1-on-each-dm_task_set_cookie-ca.patch ++++++ >From a820a68619c10108666f8093545837233c954046 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha <[email protected]> Date: Tue, 23 Oct 2012 11:40:53 +0200 Subject: [PATCH] udev_sync: cookie_set=1 on each dm_task_set_cookie call cookie_set variable found in the struct dm_task should be always set to 1 after dm_task_set_cookie_call, even if udev_sync is disabled as the cookie itself carries synchronization informations *as well as* extra flags to control other aspects of udev support. For example, one could disable the synchronization itself, but still direct the libdm code to disable library fallback via DM_UDEV_DISABLE_LIBRARY_FALLBACK flag. These extra flags still need to be carried out! A concrete example: $ dmsetup create test --table "0 1 zero" --noudevsync This disables synchronization with udev. As the --verifyudev option is not used, we don't want to do any corrections. In other words, we need DM_UDEV_DISABLE_LIBRARY_FALLBACK flag to be used. However, with --noudevsync this was not the case - the flag was ignored! This patch fixes the case when noudevsync is used but there are still some extra flags passed within the cookie flag part. The synchronization part of the cookie stays zero (which is ok as dm_udev_wait call on such a cookie is simply a NOOP). --- WHATS_NEW_DM | 1 + libdm/libdm-common.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 2d0b05c..7c636f0 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.77 - 15th October 2012 =================================== + Fix dm_task_set_cookie to properly process udev flags if udev_sync disabled. Support unmount of thin volumes from pool above thin pool threshold. Update man page to reflect that dm UUIDs are being mangled as well. Apply 'dmsetup mangle' for dm UUIDs besides dm names. diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index b8533ed..afdac89 100644 --- a/libdm/libdm-common.c +++ b/libdm/libdm-common.c @@ -1838,6 +1838,7 @@ int dm_task_set_cookie(struct dm_task *dmt, uint32_t *cookie, uint16_t flags) if (dm_cookie_supported()) dmt->event_nr = flags << DM_UDEV_FLAGS_SHIFT; *cookie = 0; + dmt->cookie_set = 1; return 1; } @@ -2207,6 +2208,7 @@ int dm_task_set_cookie(struct dm_task *dmt, uint32_t *cookie, uint16_t flags) if (!dm_udev_get_sync_support()) { *cookie = 0; + dmt->cookie_set = 1; return 1; } -- 1.7.10.4 -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
