main - pvscan: fix filter symlink checks
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=05d9a013516f23e27b0...
Commit: 05d9a013516f23e27b04b6933705c6ae45f9f5b2
Parent: d5402e55f6b9d3a5f407502ce5c7a8a5bfd12243
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Dec 1 13:40:09 2021 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Dec 1 13:42:32 2021 -0600
pvscan: fix filter symlink checks
Fixes commit "pvscan: match device arg to filter symlink"
which failed to account for the fact that filter entries
are not just path names but include "a" or "r", etc.
---
tools/pvscan.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 429b5e676..dcf183a46 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -828,6 +828,7 @@ static int _filter_uses_symlinks(struct cmd_context *cmd, int filter_cfg)
{
const struct dm_config_node *cn;
const struct dm_config_value *cv;
+ const char *fname;
if ((cn = find_config_tree_array(cmd, filter_cfg, NULL))) {
for (cv = cn->v; cv; cv = cv->next) {
@@ -836,19 +837,22 @@ static int _filter_uses_symlinks(struct cmd_context *cmd, int filter_cfg)
if (!cv->v.str)
continue;
- if (!strncmp(cv->v.str, "/dev/disk/", 10))
+ fname = cv->v.str;
+
+ if (fname[0] != 'a')
+ continue;
+
+ if (strstr(fname, "/dev/disk/"))
return 1;
- if (!strncmp(cv->v.str, "/dev/mapper/", 12))
+ if (strstr(fname, "/dev/mapper/"))
return 1;
- if (cv->v.str[0] == '/')
- continue;
/* In case /dev/disk/by was omitted */
- if (strstr(cv->v.str, "lvm-pv-uuid"))
+ if (strstr(fname, "lvm-pv-uuid"))
return 1;
- if (strstr(cv->v.str, "dm-uuid"))
+ if (strstr(fname, "dm-uuid"))
return 1;
- if (strstr(cv->v.str, "wwn-"))
+ if (strstr(fname, "wwn-"))
return 1;
}
}
2 years, 4 months
main - devices file: don't write in test mode
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d5402e55f6b9d3a5f40...
Commit: d5402e55f6b9d3a5f407502ce5c7a8a5bfd12243
Parent: 71e7ebb3e409be91b6c29e25ebfdd73c27f02902
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Dec 1 10:08:08 2021 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Dec 1 10:08:08 2021 -0600
devices file: don't write in test mode
---
lib/device/device_id.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 06d64a494..bfee7d418 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -678,6 +678,9 @@ int device_ids_write(struct cmd_context *cmd)
cmd->enable_devices_file = 1;
}
+ if (test_mode())
+ return 1;
+
if (_devices_file_version[0]) {
if (sscanf(_devices_file_version, "%u.%u.%u", &df_major, &df_minor, &df_counter) != 3) {
/* don't update a file we can't parse */
2 years, 4 months
main - tests devicesfile-devname.sh drop mdadm chunk
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=71e7ebb3e409be91b6c...
Commit: 71e7ebb3e409be91b6c29e25ebfdd73c27f02902
Parent: 36095ac374edeccd256bf565aa66d629ad5480c3
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Dec 1 08:56:05 2021 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Dec 1 08:56:05 2021 -0600
tests devicesfile-devname.sh drop mdadm chunk
---
test/shell/devicesfile-devname.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/shell/devicesfile-devname.sh b/test/shell/devicesfile-devname.sh
index a99fe3e9a..338637275 100644
--- a/test/shell/devicesfile-devname.sh
+++ b/test/shell/devicesfile-devname.sh
@@ -590,7 +590,7 @@ OPVID2=`pvs "$dev2" --noheading -o uuid | awk '{print $1}'`
PVID1=`pvs "$dev1" --noheading -o uuid | tr -d - | awk '{print $1}'`
PVID2=`pvs "$dev2" --noheading -o uuid | tr -d - | awk '{print $1}'`
-mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=2 "$dev3" "$dev4"
+mdadm --create --metadata=1.0 "$mddev" --level 1 --raid-devices=2 "$dev3" "$dev4"
wait_md_create "$mddev"
sed -e "s|DEVNAME=$dev1|DEVNAME=$dev3|" "$ORIG" > tmp1.devices
2 years, 4 months
main - spec: Add lvmautoactivation man page
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=36095ac374edeccd256...
Commit: 36095ac374edeccd256bf565aa66d629ad5480c3
Parent: 470b967bc5a66b3b066af5694a10220be7a2a155
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Dec 1 15:35:40 2021 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Dec 1 15:36:34 2021 +0100
spec: Add lvmautoactivation man page
---
spec/packages.inc | 1 +
1 file changed, 1 insertion(+)
diff --git a/spec/packages.inc b/spec/packages.inc
index 74d795520..9b4eba263 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -88,6 +88,7 @@ fi
%{_sbindir}/lvmpolld
%endif
%{_mandir}/man5/lvm.conf.5.gz
+%{_mandir}/man7/lvmautoactivation.7.gz
%{_mandir}/man7/lvmsystemid.7.gz
%{_mandir}/man7/lvmreport.7.gz
%{_mandir}/man7/lvmraid.7.gz
2 years, 4 months