From e4104ab6f2415f7a592182fcf8aba676625026a9 Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Mon, 18 Jun 2012 18:07:05 +0100 Subject: [PATCH] New upstream, using device-mapper-persistent-data. --- .gitignore | 1 + LVM2.2.02.95.tgz.asc | 7 - LVM2.2.02.96.tgz.asc | 7 + ...vm-binary-path-in-lvmetad-udev-rules.patch | 21 -- ...orted-udev_get_dev_path-libudev-call.patch | 202 ------------------ ...he-instead-of-vgscan-in-init-scripts.patch | 39 ---- lvm2.spec | 88 +++++++- sources | 2 +- upstream | 2 +- 9 files changed, 88 insertions(+), 281 deletions(-) delete mode 100644 LVM2.2.02.95.tgz.asc create mode 100644 LVM2.2.02.96.tgz.asc delete mode 100644 lvm2-2_02_96-detect-lvm-binary-path-in-lvmetad-udev-rules.patch delete mode 100644 lvm2-2_02_96-remove-unsupported-udev_get_dev_path-libudev-call.patch delete mode 100644 lvm2-2_02_96-use-pvscan-cache-instead-of-vgscan-in-init-scripts.patch diff --git a/.gitignore b/.gitignore index 46a2621..4108de9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /LVM2.2.02.93.tgz /LVM2.2.02.94.tgz /LVM2.2.02.95.tgz +/LVM2.2.02.96.tgz diff --git a/LVM2.2.02.95.tgz.asc b/LVM2.2.02.95.tgz.asc deleted file mode 100644 index b3214b6..0000000 --- a/LVM2.2.02.95.tgz.asc +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.2.1 (GNU/Linux) - -iD8DBQBPVYjGIoGRwVZ+LBcRAl9VAJ0RcoV/uaduzKjD5x9/7K73G++c4ACfXflG -xtCi+Co4bjDQ95FjYPNPZls= -=sPNd ------END PGP SIGNATURE----- diff --git a/LVM2.2.02.96.tgz.asc b/LVM2.2.02.96.tgz.asc new file mode 100644 index 0000000..8c34971 --- /dev/null +++ b/LVM2.2.02.96.tgz.asc @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.11 (GNU/Linux) + +iEYEABECAAYFAk/SjXMACgkQIoGRwVZ+LBflPQCfYYnlsPfqDPCKn/5RgVcC5E7i +N0YAn2RXoJv+IobEHT5WdXkgNdJ/00le +=tmCf +-----END PGP SIGNATURE----- diff --git a/lvm2-2_02_96-detect-lvm-binary-path-in-lvmetad-udev-rules.patch b/lvm2-2_02_96-detect-lvm-binary-path-in-lvmetad-udev-rules.patch deleted file mode 100644 index 15502c6..0000000 --- a/lvm2-2_02_96-detect-lvm-binary-path-in-lvmetad-udev-rules.patch +++ /dev/null @@ -1,21 +0,0 @@ - udev/69-dm-lvm-metad.rules | 7 ++++++- - 1 files changed, 6 insertions(+), 1 deletions(-) - -diff --git a/udev/69-dm-lvm-metad.rules b/udev/69-dm-lvm-metad.rules -index d6e4169..d272e6e 100644 ---- a/udev/69-dm-lvm-metad.rules -+++ b/udev/69-dm-lvm-metad.rules -@@ -19,7 +19,12 @@ SUBSYSTEM!="block", GOTO="lvm_end" - # Device-mapper devices are processed only on change event or on supported synthesized event. - KERNEL=="dm-[0-9]*", ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="lvm_end" - -+# Set proper sbin path, /sbin has higher priority than /usr/sbin. -+ENV{LVM_SBIN_PATH}="/sbin" -+TEST!="$env{LVM_SBIN_PATH}/lvm", ENV{LVM_SBIN_PATH}="/usr/sbin" -+TEST!="$env{LVM_SBIN_PATH}/lvm", GOTO="lvm_end" -+ - # Only process devices already marked as a PV - this requires blkid to be called before. --ENV{ID_FS_TYPE}=="LVM2_member|LVM1_member", RUN+="$env{DM_SBIN_PATH}/pvscan --cache --major $major --minor $minor" -+ENV{ID_FS_TYPE}=="LVM2_member|LVM1_member", RUN+="$env{LVM_SBIN_PATH}/lvm pvscan --cache --major $major --minor $minor" - - LABEL="lvm_end" diff --git a/lvm2-2_02_96-remove-unsupported-udev_get_dev_path-libudev-call.patch b/lvm2-2_02_96-remove-unsupported-udev_get_dev_path-libudev-call.patch deleted file mode 100644 index 9e81d2f..0000000 --- a/lvm2-2_02_96-remove-unsupported-udev_get_dev_path-libudev-call.patch +++ /dev/null @@ -1,202 +0,0 @@ - WHATS_NEW_DM | 4 ++++ - lib/commands/toolcontext.c | 28 ++++++++++++++++------------ - lib/misc/lvm-wrappers.c | 14 -------------- - lib/misc/lvm-wrappers.h | 1 - - libdm/libdevmapper.h | 3 +++ - tools/dmsetup.c | 30 ++++++++++++------------------ - 6 files changed, 35 insertions(+), 45 deletions(-) - -diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM -index f159905..a2a0f93 100644 ---- a/WHATS_NEW_DM -+++ b/WHATS_NEW_DM -@@ -1,3 +1,7 @@ -+Version 1.02.75 - -+================================ -+ Remove unsupported udev_get_dev_path libudev call used for checking udev dir. -+ - Version 1.02.74 - 6th March 2012 - ================================ - Check for multiply-mangled names in auto mangling mode. -diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c -index da7285d..4a71690 100644 ---- a/lib/commands/toolcontext.c -+++ b/lib/commands/toolcontext.c -@@ -650,9 +650,9 @@ static int _init_dev_cache(struct cmd_context *cmd) - { - const struct dm_config_node *cn; - const struct dm_config_value *cv; -- size_t uninitialized_var(udev_dir_len), len; -+ size_t len, udev_dir_len = strlen(DM_UDEV_DEV_DIR); -+ int len_diff; - int device_list_from_udev; -- const char *uninitialized_var(udev_dir); - - init_dev_disable_after_error_count( - find_config_tree_int(cmd, "devices/disable_after_error_count", -@@ -661,13 +661,9 @@ static int _init_dev_cache(struct cmd_context *cmd) - if (!dev_cache_init(cmd)) - return_0; - -- if ((device_list_from_udev = udev_is_running() ? -+ device_list_from_udev = udev_is_running() ? - find_config_tree_bool(cmd, "devices/obtain_device_list_from_udev", -- DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV) : 0)) { -- if (!(udev_dir = udev_get_dev_dir())) -- stack; -- udev_dir_len = (udev_dir) ? strlen(udev_dir) : 0; -- } -+ DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV) : 0; - init_obtain_device_list_from_udev(device_list_from_udev); - - if (!(cn = find_config_tree_node(cmd, "devices/scan"))) { -@@ -688,11 +684,19 @@ static int _init_dev_cache(struct cmd_context *cmd) - return 0; - } - -- if (device_list_from_udev && udev_dir) { -+ if (device_list_from_udev) { - len = strlen(cv->v.str); -- len = udev_dir_len > len ? len : udev_dir_len; -- if (strncmp(udev_dir, cv->v.str, len) || -- udev_dir[len] != cv->v.str[len]) { -+ -+ /* -+ * DM_UDEV_DEV_DIR always has '/' at its end. -+ * If the item in the conf does not have it, be sure -+ * to make the right comparison without the '/' char! -+ */ -+ len_diff = len && cv->v.str[len - 1] != '/' ? -+ udev_dir_len - 1 != len : -+ udev_dir_len != len; -+ -+ if (len_diff || strncmp(DM_UDEV_DEV_DIR, cv->v.str, len)) { - device_list_from_udev = 0; - init_obtain_device_list_from_udev(0); - } -diff --git a/lib/misc/lvm-wrappers.c b/lib/misc/lvm-wrappers.c -index 84f61a6..6cffae3 100644 ---- a/lib/misc/lvm-wrappers.c -+++ b/lib/misc/lvm-wrappers.c -@@ -65,16 +65,6 @@ bad: - return 0; - } - --const char *udev_get_dev_dir(void) --{ -- if (!_udev) { -- log_debug(_no_context_msg); -- return NULL; -- } -- -- return udev_get_dev_path(_udev); --} -- - struct udev* udev_get_library_context(void) - { - return _udev; -@@ -96,10 +86,6 @@ int udev_is_running(void) - return 0; - } - --const char *udev_get_dev_dir(void) --{ -- return NULL; --} - #endif - - int lvm_getpagesize(void) -diff --git a/lib/misc/lvm-wrappers.h b/lib/misc/lvm-wrappers.h -index f5b381c..e43f831 100644 ---- a/lib/misc/lvm-wrappers.h -+++ b/lib/misc/lvm-wrappers.h -@@ -24,7 +24,6 @@ struct udev *udev_get_library_context(void); - int udev_init_library_context(void); - void udev_fin_library_context(void); - int udev_is_running(void); --const char *udev_get_dev_dir(void); - - int lvm_getpagesize(void); - -diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h -index 7df4db8..1f780a3 100644 ---- a/libdm/libdevmapper.h -+++ b/libdm/libdevmapper.h -@@ -1500,6 +1500,9 @@ struct dm_config_node *dm_config_clone_node(struct dm_config_tree *cft, const st - - struct dm_pool *dm_config_memory(struct dm_config_tree *cft); - -+/* Udev device directory. */ -+#define DM_UDEV_DEV_DIR "/dev/" -+ - /* Cookie prefixes. - * - * The cookie value consists of a prefix (16 bits) and a base (16 bits). -diff --git a/tools/dmsetup.c b/tools/dmsetup.c -index d293706..4275fc6 100644 ---- a/tools/dmsetup.c -+++ b/tools/dmsetup.c -@@ -1008,11 +1008,9 @@ static int _udevcookies(CMD_ARGS) - #else /* UDEV_SYNC_SUPPORT */ - static int _set_up_udev_support(const char *dev_dir) - { -- struct udev *udev; -- const char *udev_dev_dir; -- size_t udev_dev_dir_len; - int dirs_diff; - const char *env; -+ size_t len = strlen(dev_dir), udev_dir_len = strlen(DM_UDEV_DEV_DIR); - - if (_switches[NOUDEVSYNC_ARG]) - dm_udev_set_sync_support(0); -@@ -1030,14 +1028,6 @@ static int _set_up_udev_support(const char *dev_dir) - " defined by --udevcookie option.", - _udev_cookie); - -- if (!(udev = udev_new()) || -- !(udev_dev_dir = udev_get_dev_path(udev)) || -- !*udev_dev_dir) { -- log_error("Could not get udev dev path."); -- return 0; -- } -- udev_dev_dir_len = strlen(udev_dev_dir); -- - /* - * Normally, there's always a fallback action by libdevmapper if udev - * has not done its job correctly, e.g. the nodes were not created. -@@ -1049,12 +1039,17 @@ static int _set_up_udev_support(const char *dev_dir) - * is the same as "dev path" used by libdevmapper. - */ - -- /* There's always a slash at the end of dev_dir. But check udev_dev_dir! */ -- if (udev_dev_dir[udev_dev_dir_len - 1] != '/') -- dirs_diff = strncmp(dev_dir, udev_dev_dir, udev_dev_dir_len); -- else -- dirs_diff = strcmp(dev_dir, udev_dev_dir); - -+ /* -+ * DM_UDEV_DEV_DIR always has '/' at its end. -+ * If the dev_dir does not have it, be sure -+ * to make the right comparison without the '/' char! -+ */ -+ if (dev_dir[len - 1] != '/') -+ udev_dir_len--; -+ -+ dirs_diff = udev_dir_len != len || -+ strncmp(DM_UDEV_DEV_DIR, dev_dir, len); - _udev_only = !dirs_diff && (_udev_cookie || !_switches[VERIFYUDEV_ARG]); - - if (dirs_diff) { -@@ -1064,11 +1059,10 @@ static int _set_up_udev_support(const char *dev_dir) - "about udev not working correctly while processing " - "particular nodes will be suppressed. These nodes " - "and symlinks will be managed in each directory " -- "separately.", dev_dir, udev_dev_dir); -+ "separately.", dev_dir, DM_UDEV_DEV_DIR); - dm_udev_set_checking(0); - } - -- udev_unref(udev); - return 1; - } - diff --git a/lvm2-2_02_96-use-pvscan-cache-instead-of-vgscan-in-init-scripts.patch b/lvm2-2_02_96-use-pvscan-cache-instead-of-vgscan-in-init-scripts.patch deleted file mode 100644 index f2d219a..0000000 --- a/lvm2-2_02_96-use-pvscan-cache-instead-of-vgscan-in-init-scripts.patch +++ /dev/null @@ -1,39 +0,0 @@ - scripts/lvm2_lvmetad_init_red_hat.in | 4 ++-- - scripts/lvm2_lvmetad_systemd_red_hat.service.in | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/scripts/lvm2_lvmetad_init_red_hat.in b/scripts/lvm2_lvmetad_init_red_hat.in -index 1e64a6c..886944e 100644 ---- a/scripts/lvm2_lvmetad_init_red_hat.in -+++ b/scripts/lvm2_lvmetad_init_red_hat.in -@@ -38,7 +38,7 @@ DAEMON=lvmetad - exec_prefix=@exec_prefix@ - sbindir=@sbindir@ - --lvm_vgscan=${sbindir}/vgscan -+lvm_pvscan="${sbindir}/lvm pvscan --cache" - - LOCK_FILE="/var/lock/subsys/$DAEMON" - PID_FILE="@DEFAULT_RUN_DIR@/${DAEMON}.pid" -@@ -55,7 +55,7 @@ rh_status_q() { - start() - { - ret=0 -- action "Starting LVM metadata daemon:" $DAEMON && ${lvm_vgscan} || ret=$? -+ action "Starting LVM metadata daemon:" $DAEMON && ${lvm_pvscan} > /dev/null || ret=$? - return $ret - } - -diff --git a/scripts/lvm2_lvmetad_systemd_red_hat.service.in b/scripts/lvm2_lvmetad_systemd_red_hat.service.in -index ec43494..6839c87 100644 ---- a/scripts/lvm2_lvmetad_systemd_red_hat.service.in -+++ b/scripts/lvm2_lvmetad_systemd_red_hat.service.in -@@ -9,7 +9,7 @@ Conflicts=shutdown.target - Type=forking - NonBlocking=true - ExecStart=@sbindir@/lvmetad --ExecStartPost=@sbindir@/vgscan -+ExecStartPost=@sbindir@/lvm pvscan --cache - ExecReload=@sbindir@/lvmetad -R - PIDFile=@DEFAULT_RUN_DIR@/lvmetad.pid - diff --git a/lvm2.spec b/lvm2.spec index acab3de..9a037af 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -1,4 +1,4 @@ -%define device_mapper_version 1.02.74 +%define device_mapper_version 1.02.75 %define enable_thin 0 %define enable_cluster 1 @@ -53,6 +53,7 @@ # rawhide %define udev_version 183-1 %define enable_thin 1 +%define persistent_data_version 0.1.4 %define enable_openais 0 %define corosync_version 1.99.9-1 %define udev_systemd_merge 1 @@ -90,16 +91,13 @@ Summary: Userland logical volume management tools Name: lvm2 -Version: 2.02.95 -Release: 8%{?dist} +Version: 2.02.96 +Release: 1%{?dist} License: GPLv2 Group: System Environment/Base URL: http://sources.redhat.com/lvm2 Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz Patch0: lvm2-set-default-preferred_names.patch -Patch1: lvm2-2_02_96-detect-lvm-binary-path-in-lvmetad-udev-rules.patch -Patch2: lvm2-2_02_96-use-pvscan-cache-instead-of-vgscan-in-init-scripts.patch -Patch3: lvm2-2_02_96-remove-unsupported-udev_get_dev_path-libudev-call.patch BuildRequires: libselinux-devel >= 1.30.19-4, libsepol-devel BuildRequires: ncurses-devel @@ -135,6 +133,9 @@ Requires(post): chkconfig Requires(preun): chkconfig %endif Requires: module-init-tools +%if %{enable_thin} +Requires: device-mapper-persistent-data >= %{persistent_data_version} +%endif %description LVM2 includes all of the support for handling read/write operations on @@ -147,9 +148,6 @@ or more physical volumes and creating one or more logical volumes %prep %setup -q -n LVM2.%{version} %patch0 -p1 -b preferred_names -%patch1 -p1 -b .lvm_path -%patch2 -p1 -b .pvscan_cache -%patch3 -p1 -b .libudev_dev_path %build %define _exec_prefix "" @@ -164,7 +162,7 @@ or more physical volumes and creating one or more logical volumes %endif %if %{enable_thin} -%define configure_thin --with-thin=internal +%define configure_thin --with-thin=internal --with-thin-check=%{_sbindir}/thin_check %endif %if %{enable_lvmetad} @@ -697,6 +695,76 @@ the device-mapper event library. /usr%{_libdir}/pkgconfig/devmapper-event.pc %changelog +* Mon Jun 18 2012 Alasdair Kergon - 2.02.96-1 +- Require device-mapper-persistent-data package for thin provisioning. +- Set delay_resume_if_new on deptree snapshot origin. +- Log value chosen in _find_config_bool like other variable types do. +- Wait for dmeventd to exit after sending it DM_EVENT_CMD_DIE when restarting. +- Append 'Used' to {Blk}DevNames/DevNos dmsetup report headers for clarity. +- Remove dmeventd fifos on exit if they are not managed by systemd. +- Use SD_ACTIVATION environment variable in systemd units to detect systemd. +- Only start a new dmeventd instance on restart if one was already running. +- Extend the time waited for input from dmeventd fifo to 5 secs. (1.02.73) +- Fix error paths for regex filter initialization. +- Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90) +- Fix alloc cling to cling to PVs already found with contiguous policy. +- Fix cling policy not to behave like normal policy if no previous LV seg. +- Fix allocation loop not to use later policies when --alloc cling without tags. +- Fix division by zero if PV with zero PE count is used during vgcfgrestore. +- Add initial support for thin pool lvconvert. +- Fix lvrename for thin volumes (regression in for_each_sub_lv). (2.02.89) +- Fix up-convert when mirror activation is controlled by volume_list and tags. +- Warn of deadlock risk when using snapshots of mirror segment type. +- Fix bug in cmirror that caused incorrect status info to print on some nodes. +- Remove statement that snapshots cannot be tagged from lvm man page. +- Disallow changing cluster attribute of VG while RAID LVs are active. +- Fix lvconvert error message for non-mergeable volumes. +- Allow subset of failed devices to be replaced in RAID LVs. +- Prevent resume from creating error devices that already exist from suspend. +- Update and correct lvs man page with supported column names. +- Handle replacement of an active device that goes missing with an error device. +- Change change raid1 segtype always to request a flush when suspending. +- Add udev info and context to lvmdump. +- Add lvmetad man page. +- Fix RAID device replacement code so that it works under snapshot. +- Fix inability to split RAID1 image while specifying a particular PV. +- Update man pages to give them all the same look&feel. +- Fix lvresize of thin pool for striped devices. +- For lvresize round upward when specifying number of extents. +- For lvcreate with %FREE support rounding downward stripe alignment. +- Change message severity to log_very_verbose for missing dev info in udev db. +- Fix lvconvert when specifying removal of a RAID device other than last one. +- Fix ability to handle failures in mirrored log in dmeventd plugin. (2.02.89) +- Fix unlocking volume group in vgreduce in error path. +- Cope when VG name is part of the supplied name in lvconvert --splitmirrors -n. +- Fix exclusive lvchange running from other node. (2.02.89) +- Add 'vgscan --cache' functionality for consistency with 'pvscan --cache'. +- Keep exclusive activation in pvmove if LV is already active. +- Disallow exclusive pvmove if some affected LVs are not exclusively activated. +- Remove unused and wrongly set cluster VG flag from clvmd lock query command. +- Fix pvmove for exclusively activated LV pvmove in clustered VG. (2.02.86) +- Update and fix monitoring of thin pool devices. +- Check hash insert success in lock_vg in clvmd. +- Check for buffer overwrite in get_cluster_type() in clvmd. +- Fix global/detect_internal_vg_cache_corruption config check. +- Fix initializiation of thin monitoring. (2.02.92) +- Cope with improperly formatted device numbers in /proc/devices. (2.02.91) +- Exit if LISTEN_PID environment variable incorrect in lvmetad systemd handover. +- Fix fsadm propagation of -e option. +- Fix fsadm parsing of /proc/mounts files (don't check for substrings). +- Fix fsadm usage of arguments with space. +- Fix arg_int_value alongside ARG_GROUPABLE --major/--minor for lvcreate/change. +- Fix name conflicts that prevent down-converting RAID1 when specifying a device +- Improve thin_check option passing and use configured path. +- Add --with-thin-check configure option for path to thin_check. +- Fix error message when pvmove LV activation fails with name already in use. +- Better structure layout for device_info in dev_subsystem_name(). +- Change message severity for creation of VG over uninitialised devices. +- Fix error path for failed toolcontext creation. +- Don't unlink socket on lvmetad shutdown if instantiated from systemd. +- Restart lvmetad automatically from systemd if it exits from uncaught signal. +- Fix warn msg for thin pool chunk size and update man for chunksize. (2.02.89) + * Thu Jun 07 2012 Kay Sievers - 2.02.95-8 - Remove explicit Requires: libudev, rpm takes care of that: $ rpm -q --requires device-mapper | grep udev diff --git a/sources b/sources index c844adb..f53aaef 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bd470a802046c807603618a443732ea7 LVM2.2.02.95.tgz +4637503d792e9ee35a9b71387bcd8a93 LVM2.2.02.96.tgz diff --git a/upstream b/upstream index 33bb098..778321c 100644 --- a/upstream +++ b/upstream @@ -1 +1 @@ -LVM2.2.02.94.tgz +LVM2.2.02.96.tgz