main - pre-release
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6987f318ec135ffd54a...
Commit: 6987f318ec135ffd54a05872a8aa621726fe7acb
Parent: 563105bba92f5a840d7d9f01acbc8be9daf39b32
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Mon Feb 7 18:00:54 2022 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Mon Feb 7 18:00:54 2022 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 5 +++--
WHATS_NEW_DM | 4 ++--
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index dfbf5a300..0e6ab70a9 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.03.15(2)-git (2021-10-20)
+2.03.15(2) (2022-02-07)
diff --git a/VERSION_DM b/VERSION_DM
index 5e5c70a77..d6704212f 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.183-git (2021-10-20)
+1.02.183 (2022-02-07)
diff --git a/WHATS_NEW b/WHATS_NEW
index 16235514e..dda9954fe 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
-Version 2.03.15 -
-===================================
+Version 2.03.15 - 07th February 2022
+====================================
+ Remove service based autoactivation. global/event_activation = 0 is NOOP.
Improve support for metadata profiles for --type writecache.
Use cache or active DM device when available with new kernels.
Introduce function to utilize UUIDs from DM_DEVICE_LIST.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index dfb075dcc..778437262 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.183 -
-====================================
+Version 1.02.183 - 07th February 2022
+=====================================
Unmangle UUIDs for DM_DEVICE_LIST ioctl.
Version 1.02.181 - 20th October 2021
1 year, 9 months
v2_03_15 annotated tag has been created
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=890c0635554075e122e...
Commit: 890c0635554075e122ef5437b5dfb28ff6fcb128
Parent: 0000000000000000000000000000000000000000
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: 2022-02-07 17:02 +0000
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: 2022-02-07 17:02 +0000
annotated tag: v2_03_15 has been created
at 890c0635554075e122ef5437b5dfb28ff6fcb128 (tag)
tagging 6987f318ec135ffd54a05872a8aa621726fe7acb (commit)
replaces v2_03_14
Release 2.03.15
WARNING: This release removes service based autoactivation.
global/event_activation = 0 does nothing, user is responsible to
activate any volumes.
- Removed service based autoactivation.
- New man page lvmautoactivation(7).
-----BEGIN PGP SIGNATURE-----
iQJIBAABCAAyFiEE1QGkeEQK4v0TChvouREkMeUJA58FAmIBUZcUHG1jc29udG9z
QHJlZGhhdC5jb20ACgkQuREkMeUJA58IrxAAy5zBVWdMRNTClJQYv/zr5EfuIszP
Z7EqUUr6beDuUSqg8QbW7i3JFcOhdXEYnIyIVNueB/YoJEPmv2ylcaMSwkZ0mmHS
FMmvGUX9w3Ze8zZda0i/zRa3kK12uy+1eOPg0stIpm3L7wORp0b1HeG4V3ceVj3v
ZujQDpn+7+Bq1+gucOup76ynacTuirGYgvXsdf3XZYWhZek2UaLmU172y8tor/ZG
vHPOqXlpgfmO78Memx1WeEW7EBwP1FmuP9rO1ZksjCx01EdKe6buKnEJdticikH3
bjGPFPrY8RxLgoqUDe8dNQ408FrhzBKJTyBEXL+YBux80CB/f/eSweSZGlZ1R+/d
6XfM7L0uBtEP+RaBDxEUZXeqpaA3h6acLNXnlZ3cTsPBt2dOsEIss/F4CyfV+RFP
56JgfgVMcHvwyvVkSP4QAnmEatEsVvr2w4P9eG5NpugWwugltEbzyLP+ItYU5g1K
8+vchwd17qTsDojmMsnJAiKxwLm+rm4M6kKvOllr14o6cCDAh9xS3TN/LJhLas4n
q5gsGzTcuO4XcVPOeOELs8nQCbbGLZ9+zcvKcTqGXOs1EDuSLW54toBYzmDQZPkH
I/pFt4RDZpyXFCrS/UV5yhKNYyEkAuKvJVGki6pglQezVxhC72hjRkxxNTN1U9Au
LJuVu51Gfr4kiDI=
=h5AN
-----END PGP SIGNATURE-----
Andrew Walsh (1):
vdo: ensure VDO config is removed
Christian Hesse (1):
The path is known anyway and should be the bullet proof option.
David Teigland (64):
pvscan: fix messages from coverity changes
vgimportdevices: skip lvmlockd locking
hints: remove the cmd hints list
filter-sysfs: skip when device id is set
lvmdevices: increase open file limit
add hints interface to the pvs_online file information
rename pvscan_cache_single to expect_missing_vg_device in cmd
vgchange -aay: optimize device scan using pvs_online files
move code from pvscan.c to online.c
lvm2-pvscan: include --autoactivation event
vgchange -aay: optimize device list using pvs_online files
fix device name from devno for partitions
vgchange -aay: fall back to dev_cache_scan if optimization fails
vgchange -aay: improve unexpected command variations
pvs_online: include devname in pvid files
filter-sysfs: support old kernels without sys/dev/block
vgchange: move autoactivation setup code
vgchange autoactivation: lock vg early to avoid second label scan
tests: udev-pvscan-vgchange fix wait
tests vgchange-pvs-online: clean up with devices file
pvscan: consistent creation of pvs_lookup file
online files: fix vgname check
tests: udev-pvscan-vgchange clear services
device_id: match different dm device names
vgchange autoactivation: error path cleanup
tests devicesfile-devname: remove searched_devnames
device_id: fix search on filtered device
device_id: searched_devnames improvements
tests pv-ext-flags: work with devices file
Revert "tests devicesfile-devname: remove searched_devnames"
display: ignore --reportformat
devices: exclude multipath components based on matching wwid
fix spelling of pruning
devices: exclude md components when duplicate pvs are seen
man: lvmautoactivation
pvscan: match device arg to filter symlink
pvscan: limit md device_hint for slow autoactivation
tests devicesfile-devname.sh drop mdadm chunk
devices file: don't write in test mode
pvscan: fix filter symlink checks
pvscan: fix error message for invalid devname
print warning about unrecognized journal option value
device_id: handle wwid with spaces or control characters
man: add section about static autoactivation
lvcreate: include recent options
udev: remove -r from systemd-run
man lvmautoactivation: replace systemctl with journalctl
lvmlockd: cleanup after sanlock_rem_lockspace error
handle duplicate vgids
Revert "handle duplicate vgids"
vgsplit: don't reread vg_to
lvmcache: remove lvmcache_update_vg_from_write
handle duplicate vgids
remove unused variable
pvcreate: overwrite partition header with -f
lvmdevices check: error exit if update is needed
Revert "pvcreate: overwrite partition header with -f"
device_id: fix search for renamed device when the wwid is ignored
lvmdevices: fix checks when adding entries
remove static autoactivation
Revert "writecache: handle options from lvm.conf"
writecache: look for settings in lvm.conf
lvmdevices: make deldev work for missing device
tests: devicesfile-edit
Marian Csontos (3):
post-release
spec: Add lvmautoactivation man page
pre-release
Martin Wilck (1):
udev: create symlinks and watch even in suspended state
Zdenek Kabelac (23):
toollib: avoid repeated remove of online vg
hash: raise hash table size
toolcontext: reuse destroy_config_context
activate: cache driver_version result
libdm: correct version check
lvmcmdline: comment reset of configuration settings
activate: device_is_usable
libdm: unmangling UUID for DM_DEVICE_LIST
devicemapper: add dm_task_get_device_list
activate: add get_device_list
label: cache dm device list
writecache: handle options from lvm.conf
lvcreate: fix crash for unspecified LV name for writecache
lvcreate: cachesettings works also with writecache
man: doc writecache profile support
test: check writecache profile support
lvcreate: code move
gcc: snprintf may need here upto 18 bytes
gcc: increate buffer sizes
test: remove leaked exit
tools: missing sync after deactivation
activation: use lv_is_active
tests: skip test part when missed in kernel
������ (1):
devices: recognise rbd (ceph rados block device)
1 year, 9 months
main - tests: devicesfile-edit
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=563105bba92f5a840d7...
Commit: 563105bba92f5a840d7d9f01acbc8be9daf39b32
Parent: 3fce6a81f82f2b2b1f75e5d49dbffc77bd637b3c
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Feb 3 16:58:12 2022 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Feb 3 16:58:12 2022 -0600
tests: devicesfile-edit
test lvmdevices add/del
---
test/shell/devicesfile-edit.sh | 224 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 224 insertions(+)
diff --git a/test/shell/devicesfile-edit.sh b/test/shell/devicesfile-edit.sh
new file mode 100644
index 000000000..1675cb732
--- /dev/null
+++ b/test/shell/devicesfile-edit.sh
@@ -0,0 +1,224 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+test_description='devices file editing with lvmdevices'
+
+. lib/inittest
+
+aux lvmconf 'devices/scan = "/dev"'
+
+aux prepare_devs 1
+
+# The tests run with system dir of "/etc" but lvm when running
+# normally has cmd->system_dir set to "/etc/lvm".
+DFDIR="$LVM_SYSTEM_DIR/devices"
+mkdir -p "$DFDIR" || true
+DF="$DFDIR/system.devices"
+
+aux lvmconf 'devices/use_devicesfile = 1'
+
+losetup -h | grep sector-size || skip
+which fallocate || skip
+
+fallocate -l 2M loopa
+fallocate -l 2M loopb
+
+setup_loop_devs() {
+ for i in {1..5} ; do
+ LOOP1=$(losetup -f loopa --show || true)
+ test -n "$LOOP1" && break
+ done
+ for i in {1..5} ; do
+ LOOP2=$(losetup -f loopb --show || true)
+ test -n "$LOOP2" && break
+ done
+}
+
+setup_loop_devs
+
+# Tests of devices without PV on them.
+
+# add/del with default idtype loop_file
+lvmdevices --adddev "$LOOP1"
+grep "$LOOP1" $DF
+lvmdevices --adddev "$LOOP2"
+grep "$LOOP2" $DF
+grep "IDTYPE=loop_file" $DF
+not grep "IDTYPE=devname" $DF
+lvmdevices --deldev "$LOOP1"
+not grep "$LOOP1" $DF
+lvmdevices --deldev "$LOOP2"
+not grep "$LOOP2" $DF
+
+# add/del with non-default idtype devname
+lvmdevices --adddev "$LOOP1" --deviceidtype devname
+grep "$LOOP1" $DF
+lvmdevices --adddev "$LOOP2" --deviceidtype devname
+grep "$LOOP2" $DF
+grep "IDTYPE=devname" $DF
+not grep "IDTYPE=loop_file" $DF
+lvmdevices --deldev "$LOOP1"
+not grep "$LOOP1" $DF
+lvmdevices --deldev "$LOOP2"
+not grep "$LOOP2" $DF
+
+# add/del when dev is missing, using default idtype
+lvmdevices --adddev "$LOOP1"
+grep "$LOOP1" $DF
+lvmdevices --adddev "$LOOP2"
+grep "$LOOP2" $DF
+losetup -D
+grep "$LOOP1" $DF
+grep "$LOOP2" $DF
+lvmdevices --deldev "$LOOP1"
+not grep "$LOOP1" $DF
+lvmdevices --deldev "$LOOP2"
+not grep "$LOOP2" $DF
+not lvmdevices --adddev "$LOOP1"
+not lvmdevices --adddev "$LOOP2"
+not grep "$LOOP1" $DF
+not grep "$LOOP2" $DF
+setup_loop_devs
+rm $DF
+
+# add/del when dev is missing, using devname idtype
+lvmdevices --adddev "$LOOP1" --deviceidtype devname
+grep "$LOOP1" $DF
+lvmdevices --adddev "$LOOP2" --deviceidtype devname
+grep "$LOOP2" $DF
+losetup -D
+grep "$LOOP1" $DF
+grep "$LOOP2" $DF
+lvmdevices --deldev "$LOOP1"
+not grep "$LOOP1" $DF
+lvmdevices --deldev "$LOOP2"
+not grep "$LOOP2" $DF
+setup_loop_devs
+rm $DF
+
+# Tests of devices with PV on them.
+
+touch $DF
+pvcreate "$LOOP1"
+pvcreate "$LOOP2"
+# PVID without dashes for matching devices file fields
+PVID1=`pvs "$LOOP1" --noheading -o uuid | tr -d - | awk '{print $1}'`
+PVID2=`pvs "$LOOP2" --noheading -o uuid | tr -d - | awk '{print $1}'`
+# PVID with dashes for matching pvs -o+uuid output
+OPVID1=`pvs "$LOOP1" --noheading -o uuid | awk '{print $1}'`
+OPVID2=`pvs "$LOOP2" --noheading -o uuid | awk '{print $1}'`
+grep "$LOOP1" $DF
+grep "$LOOP2" $DF
+grep "$PVID1" $DF
+grep "$PVID2" $DF
+rm $DF
+
+# add/deldev with default idtype loop_file
+lvmdevices --adddev "$LOOP1"
+grep "$LOOP1" $DF
+grep "$PVID1" $DF
+lvmdevices --adddev "$LOOP2"
+grep "$LOOP2" $DF
+grep "$PVID2" $DF
+grep "IDTYPE=loop_file" $DF
+not grep "IDTYPE=devname" $DF
+lvmdevices --deldev "$LOOP1"
+not grep "$LOOP1" $DF
+lvmdevices --deldev "$LOOP2"
+not grep "$LOOP2" $DF
+
+# add/delpvid with default idtype loop_file
+lvmdevices --addpvid "$PVID1"
+grep "$LOOP1" $DF
+grep "$PVID1" $DF
+lvmdevices --addpvid "$PVID2"
+grep "$LOOP2" $DF
+grep "$PVID2" $DF
+grep "IDTYPE=loop_file" $DF
+not grep "IDTYPE=devname" $DF
+lvmdevices --delpvid "$PVID1"
+not grep "$LOOP1" $DF
+not grep "$PVID1" $DF
+lvmdevices --delpvid "$PVID2"
+not grep "$LOOP2" $DF
+not grep "$PVID2" $DF
+
+# add/deldev with non-default idtype devname
+lvmdevices --adddev "$LOOP1" --deviceidtype devname
+grep "$LOOP1" $DF
+grep "$PVID1" $DF
+lvmdevices --adddev "$LOOP2" --deviceidtype devname
+grep "$LOOP2" $DF
+grep "$PVID2" $DF
+grep "IDTYPE=devname" $DF
+not grep "IDTYPE=loop_file" $DF
+lvmdevices --deldev "$LOOP1"
+not grep "$LOOP1" $DF
+lvmdevices --deldev "$LOOP2"
+not grep "$LOOP2" $DF
+
+# add/delpvid with non-default idtype devname
+lvmdevices --addpvid "$PVID1" --deviceidtype devname
+grep "$LOOP1" $DF
+grep "$PVID1" $DF
+lvmdevices --addpvid "$PVID2" --deviceidtype devname
+grep "$LOOP2" $DF
+grep "$PVID2" $DF
+grep "IDTYPE=devname" $DF
+not grep "IDTYPE=loop_file" $DF
+lvmdevices --deldev "$LOOP1"
+not grep "$LOOP1" $DF
+lvmdevices --deldev "$LOOP2"
+not grep "$LOOP2" $DF
+
+# add/deldev when dev is missing, using default idtype
+lvmdevices --adddev "$LOOP1"
+grep "$LOOP1" $DF
+grep "$PVID1" $DF
+lvmdevices --adddev "$LOOP2"
+grep "$LOOP2" $DF
+grep "$PVID2" $DF
+losetup -D
+grep "$LOOP1" $DF
+grep "$LOOP2" $DF
+lvmdevices --deldev "$LOOP1"
+not grep "$LOOP1" $DF
+not grep "$PVID1" $DF
+lvmdevices --deldev "$LOOP2"
+not grep "$LOOP2" $DF
+not grep "$PVID2" $DF
+setup_loop_devs
+rm $DF
+
+# add/delpvid when dev is missing, using devname idtype
+lvmdevices --addpvid "$PVID1" --deviceidtype devname
+grep "$LOOP1" $DF
+grep "$PVID1" $DF
+lvmdevices --addpvid "$PVID2" --deviceidtype devname
+grep "$LOOP2" $DF
+grep "$PVID2" $DF
+losetup -D
+grep "$LOOP1" $DF
+grep "$LOOP2" $DF
+lvmdevices --delpvid "$PVID1"
+not grep "$LOOP1" $DF
+not grep "$PVID1" $DF
+lvmdevices --delpvid "$PVID2"
+not grep "$LOOP2" $DF
+not grep "$PVID2" $DF
+setup_loop_devs
+rm $DF
+
+# TODO: add/rem of partitions of same device
+
+losetup -D
+rm loopa loopb
1 year, 10 months
main - lvmdevices: make deldev work for missing device
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3fce6a81f82f2b2b1f7...
Commit: 3fce6a81f82f2b2b1f75e5d49dbffc77bd637b3c
Parent: f0cd54a873880286e0932c5cb38a9572677bee25
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Feb 3 16:56:03 2022 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Feb 3 16:56:03 2022 -0600
lvmdevices: make deldev work for missing device
---
lib/device/device_id.c | 6 +++---
lib/device/device_id.h | 1 +
tools/lvmdevices.c | 33 ++++++++++++++++-----------------
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 84f9f87ce..4618247ba 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -909,7 +909,7 @@ struct dev_use *get_du_for_pvid(struct cmd_context *cmd, const char *pvid)
return NULL;
}
-static struct dev_use *_get_du_for_devname(struct cmd_context *cmd, const char *devname)
+struct dev_use *get_du_for_devname(struct cmd_context *cmd, const char *devname)
{
struct dev_use *du;
@@ -1108,7 +1108,7 @@ id_done:
du_pvid = get_du_for_pvid(cmd, pvid);
/* Is there already an entry using this device's name? */
- du_devname = _get_du_for_devname(cmd, dev_name(dev));
+ du_devname = get_du_for_devname(cmd, dev_name(dev));
/* Is there already an entry using the device_id for this device? */
du_devid = _get_du_for_device_id(cmd, id->idtype, id->idname);
@@ -1529,7 +1529,7 @@ int device_ids_match_dev(struct cmd_context *cmd, struct device *dev)
struct dev_use *du;
/* First check the du entry with matching devname since it's likely correct. */
- if ((du = _get_du_for_devname(cmd, dev_name(dev)))) {
+ if ((du = get_du_for_devname(cmd, dev_name(dev)))) {
if (_match_du_to_dev(cmd, du, dev))
return 1;
}
diff --git a/lib/device/device_id.h b/lib/device/device_id.h
index a53db12e0..5d352cd81 100644
--- a/lib/device/device_id.h
+++ b/lib/device/device_id.h
@@ -41,6 +41,7 @@ void device_id_update_vg_uuid(struct cmd_context *cmd, struct volume_group *vg,
struct dev_use *get_du_for_dev(struct cmd_context *cmd, struct device *dev);
struct dev_use *get_du_for_pvid(struct cmd_context *cmd, const char *pvid);
+struct dev_use *get_du_for_devname(struct cmd_context *cmd, const char *devname);
char *devices_file_version(void);
int devices_file_exists(struct cmd_context *cmd);
diff --git a/tools/lvmdevices.c b/tools/lvmdevices.c
index c50c09f90..662b35f9a 100644
--- a/tools/lvmdevices.c
+++ b/tools/lvmdevices.c
@@ -383,28 +383,27 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
* No filter because we always want to allow removing a device
* by name from the devices file.
*/
- if (!(dev = dev_cache_get(cmd, devname, NULL))) {
- log_error("No device found for %s.", devname);
- goto bad;
- }
-
- /*
- * dev_cache_scan uses sysfs to check if an LV is using each dev
- * and sets this flag is so.
- */
- if (dev_is_used_by_active_lv(cmd, dev, NULL, NULL, NULL, NULL)) {
- if (!arg_count(cmd, yes_ARG) &&
- yes_no_prompt("Device %s is used by an active LV, continue to remove? ", devname) == 'n') {
- log_error("Device not removed.");
- goto bad;
+ if ((dev = dev_cache_get(cmd, devname, NULL))) {
+ /*
+ * dev_cache_scan uses sysfs to check if an LV is using each dev
+ * and sets this flag is so.
+ */
+ if (dev_is_used_by_active_lv(cmd, dev, NULL, NULL, NULL, NULL)) {
+ if (!arg_count(cmd, yes_ARG) &&
+ yes_no_prompt("Device %s is used by an active LV, continue to remove? ", devname) == 'n') {
+ log_error("Device not removed.");
+ goto bad;
+ }
}
+ if ((du = get_du_for_dev(cmd, dev)))
+ goto dev_del;
}
- if (!(du = get_du_for_dev(cmd, dev))) {
- log_error("Device not found in devices file.");
+ if (!(du = get_du_for_devname(cmd, devname))) {
+ log_error("No devices file entry for %s.", devname);
goto bad;
}
-
+ dev_del:
dm_list_del(&du->list);
free_du(du);
device_ids_write(cmd);
1 year, 10 months