main - vgimportdevices: skip lvmlockd locking
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b65a2c3f3a76739fb75...
Commit: b65a2c3f3a76739fb75a4a3a868cc9f143740052
Parent: 221e75316f472fbf5eb2ad206b861ea255c099ed
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Oct 25 12:11:17 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Oct 25 12:11:17 2021 -0500
vgimportdevices: skip lvmlockd locking
Help bootstrapping existing shared vgs into the devices file.
Reading the vg in vgimportdevices would require locking to be
started, but vgchange lockstart won't see the vg if it's not
in the devices file. The lvmlockd locks are not protecting
vg modifications so skipping them here won't be a problem.
---
tools/vgimportdevices.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/vgimportdevices.c b/tools/vgimportdevices.c
index 3f315f98f..2580613c4 100644
--- a/tools/vgimportdevices.c
+++ b/tools/vgimportdevices.c
@@ -172,6 +172,17 @@ int vgimportdevices(struct cmd_context *cmd, int argc, char **argv)
cmd->filter_regex_with_devices_file = 1;
cmd->create_edit_devices_file = 1;
+ /*
+ * This helps a user bootstrap existing shared VGs into the devices
+ * file. Reading the vg to import devices requires locking, but
+ * lockstart won't find the vg before it's in the devices file.
+ * So, allow importing devices without an lvmlockd lock (in a
+ * a shared vg the vg metadata won't be updated with device ids,
+ * so the lvmlockd lock isn't protecting vg modification.)
+ */
+ cmd->lockd_gl_disable = 1;
+ cmd->lockd_vg_disable = 1;
+
/*
* For each VG:
* device_id_add() each PV in the VG
1 year, 11 months
main - The path is known anyway and should be the bullet proof option.
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=221e75316f472fbf5eb...
Commit: 221e75316f472fbf5eb2ad206b861ea255c099ed
Parent: ae355ffc3f3286990778517e1ad6620368611258
Author: Christian Hesse <mail(a)eworm.de>
AuthorDate: Thu Oct 21 16:33:23 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 21 16:33:23 2021 -0500
The path is known anyway and should be the bullet proof option.
Signed-off-by: Christian Hesse <mail(a)eworm.de>
---
udev/69-dm-lvm.rules.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in
index 39e5b9807..d6bf1e0e9 100644
--- a/udev/69-dm-lvm.rules.in
+++ b/udev/69-dm-lvm.rules.in
@@ -80,7 +80,7 @@ ENV{SYSTEMD_READY}="1"
# it's better suited to appearing in the journal.
IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --udevoutput --journal=output $env{DEVNAME}"
-ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}"
+ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} (LVM_EXEC)/lvm vgchange -aay --nohints $env{LVM_VG_NAME_COMPLETE}"
GOTO="lvm_end"
LABEL="lvm_end"
1 year, 11 months
main - pvscan: fix messages from coverity changes
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ae355ffc3f328699077...
Commit: ae355ffc3f3286990778517e1ad6620368611258
Parent: 819a35cc9133889b5efc4833d8191e3e71396552
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Oct 20 16:12:41 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Oct 20 16:12:55 2021 -0500
pvscan: fix messages from coverity changes
---
tools/pvscan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 95d593d57..7d84e45d4 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -1362,7 +1362,7 @@ static int _online_devs(struct cmd_context *cmd, int do_all, struct dm_list *pvs
devsize = dev->size;
if (!devsize &&
!dev_get_size(dev, &devsize)) {
- log_print("pvscan[%d] PV %s can get device size.", getpid(), dev_name(dev));
+ log_print_pvscan(cmd, "PV %s missing device size.", dev_name(dev));
release_vg(vg);
continue;
}
@@ -1800,7 +1800,7 @@ static int _pvscan_cache_args(struct cmd_context *cmd, int argc, char **argv,
int has_pvid;
if (!label_read_pvid(devl->dev, &has_pvid)) {
- log_print("pvscan[%d] %s cannot read.", getpid(), dev_name(devl->dev));
+ log_print_pvscan(cmd, "%s cannot read label.", dev_name(devl->dev));
dm_list_del(&devl->list);
continue;
}
1 year, 11 months
v2_03_14 annotated tag has been created
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1d0d96a8fe7f7268d1a...
Commit: 1d0d96a8fe7f7268d1a22e33237f6ff55f96f5cb
Parent: 0000000000000000000000000000000000000000
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: 2021-10-20 10:24 +0000
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: 2021-10-20 10:24 +0000
annotated tag: v2_03_14 has been created
at 1d0d96a8fe7f7268d1a22e33237f6ff55f96f5cb (tag)
tagging ef4521831d15a1785e034f6c6f536a03446f6e05 (commit)
replaces v2_03_13
Release 2.03.14
- New udev autoactivation.
- vdoimport renamed to lvm_import_vdo.
- Add IMA support with 'dmsetup measure' command.
- Improved VDO support.
- New appmachineid option for global/system_id_source config option.
- New log/journal config option (and --journal CLI option)
- Many bug fixes, improvements, and clean ups.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAABAgAGBQJhb+5YAAoJELkRJDHlCQOfNjoP/1HcckWEInHGBlSWs+YNUm84
vDGO4Q3q3Z6m2kvXPKfXN4CpeP0RvC81WIOW+SQXB/TpJpSBVTKl6eFlsA77X1lx
TfI6yBD7uFAuXKqVA8zWKrTWRuV8XFww+h9Kr1ORxTnT/H8+PIj6hXYZLGgfnMJb
Dgp63zpvnYuqN/jpunt3vDhCTFnXdI37+eLyvB40yKfK2OhtDO5/IHS4B4iZ9Y4V
/NJAWHAnFhrEIUMZ+I5t4A6ac+mJX7fsoxQjGFAyzllrbnjch09Q4I7ysNxTuSYq
9NAw9sGGq8ZahUVf0uzSLn+1ISCOXr6lyLfbZoz3i8iuG6OyNbqJjv3yUn3g01Ni
Czd6w6JgtWpfAV2Mt8GdaM4lmYhfiAr/cTewviFdjVatAoTPj6ff4w28xOMQtD1p
HfiYj7NgweFhWpVtK3G/Iq0vZdJ4FhQKqbubro9iKJuZTudUB3t6idkMOJsWX/cp
Ekv/thxGYZ6zadkxOh22NM6zOXJgZT0hE8LjN5VsMQYRn0ngHnW0KzAtRJXxHOGO
IJvy4HnjvRv0Ch+BKUctQE1zGsrU5mIqCPvFypHqCGaw/B+86SbzmuuTW5pvxI8B
JhQWFxEME/fEY6oXSS/V2O9jUpE8q8CC1YQMmP3kHXuU+gJZFqFg/Ww9YUZEkm4n
XxVSeFvjf1qJSMW3faoe
=468v
-----END PGP SIGNATURE-----
Adrian Ratiu (1):
man-generator: initialize struct stat to avoid MSAN error
Alasdair G Kergon (1):
libdm: dmsetup measure support for IMA
Alex Xu (Hello71) (1):
add missing sys/file.h include
David Teigland (30):
toolcontext.h: use bit field in struct
cov: lvmlockd: rewrite string copies to avoid warnings
cov: clean up pvid and vgid usage
lvmdevices: check yes option for adding duplicate
tests: adjust for check_devicesfile
devices: apply ignorelockingfailure to devices file lock
logging: messages for found metadata
devices file: recognize old locking_type 0
vgimportclone: fix when duplicates are both in the devices file
devices: restrict device id types to specific major numbers
pvremove: apply devices file
cov: lvmlockd read_adopt_file free structs on error path
add --nohints option
lvmdevices: allow deviceidtype with addpvid
lvmcache: follow pv_id/pvid naming convention
lvmlockd: update error message
handle bad metadata text in vg_read path
device_id: update stacked PVs for vgchange uuid
config: comment all default settings
config: change default use_devicesfile to 1
system_id: new appmachineid option
pvscan: add options listlvs listvg checkcomplete
logging: to the systemd journal
new udev autoactivation
fix syslog setting
devices file: unmatching system id should just be warning
toollib: remove all devices list from process_each_pv
fix lvmcache_add log_debug pvid
fix segfault handling duplicate PVs
pvscan: only add device args to dev cache
Marian Csontos (7):
post-release
vdo: Rename vdoimport to lvm_import_vdo.
spec: Rename vdoimport to lvm_import_vdo.
configure: update
make: generate
WHATS_NEW: update
pre-release
Vojtech Trefny (1):
lvmdbusd: Use ID_FS_TYPE UDev property in udevwatch
Wu Guanghao (1):
cmdlib_lvm2_init: release cmd on failure path
Yi Wang (1):
lvchange: fix lvchange refresh failed for dm suspend or resume failed
Zdenek Kabelac (157):
vdo: rename vdoimport to lvm_import_vdo
vdo: skip zeroing for VDO LV
vdo: fix conversion of large virtual sizes
vdo: support lvcreate with skipped activation
vdo: fixes
makefiles: sanitize environment
tests: remove all debug logs when using die
vdo: add support for auto-unsafe writePolicy
vdo: lvm_import_vdo fix max_discard size
vdo: better message for missing device
vdo: more lvm_import_vdo fixes
vdo: read new sysfs path
tests: check lvm2 parses vdo statistics
vdo: lvm_import_vdo script needs to continue when vgname does not exist
vdo: man page updates
vdo: prompt with no return failure
filters: fix memleak on mpath filter destroy
cache: fix parentheses for migration_threshold
cache: filter out unsupported policy settings
cache: implement better revert path
libdm: enhance tracking of activated LVs
tests: add test for handling unknown cache settings
tests: increase size of thin-pool for newer mkfs
cov: fix copy from tmp_name buffer
cov: do not try to change passed in argv
cov: keep 64bit arithmetic
cov: keep time calculation ready for 2038
cov: initialize attr
cov: initilized more struct members
cov: add some initializers
cov: hide false positive warning
cov: make it aware we need these headers for muslC
cov: remove unused variable setting
gcc: remove invalid attribute
gcc: remove unused vg setting
clang: avoid double free on error path
clang: keep final_opts_list initialized for all paths
clang: keep metaname initialized
clang: free on arg parsing
cleanup: free already does NULL check
debug: change message level
lvm_import_vdo: --dry-run automatically verbose
cleanup: typo fix
lvmlockd: better error path
clang: add explicit test for VG
clang: ensure new_len is at least 1
gcc-fanalyzer: notices 'du' could be NULL
gcc-fanalyzer: explicit test null not pass
gcc-fanalyzer: use zeroed memory
gcc-fanalyzer: add extra check for origin_from_cow
gcc-fanalyzer: better losetup error path
gcc-fanalyzer: some explicit NULL checks for tests
gcc-fanalyzer: rewrite _fetch_string
gcc-fanalyzer: drop zeroing of pointers
tests: fix test of read buffer
tests: use single funtion to get random value
cov: pvck validates setup_device return value
cov: add error path for daemon_request_extend
cov: check fid instance is created
cov: handle teoretical sysconf failure
cov: better handle reallocation of adapt_file
cov: use different variable name
cov: handle better leak reports
cov: ensure data is not derefenced
cov: check for possible NULL segtype
cov: make read buffer obviously zero ended
cov: add explicit NULL pointer check
cov: better defined constructors
cov: capture runtime exception
cov: test for fixture being NULL pointer
cov: validate syscall result
cov: ignore syscall
cov: hide reports from optarg being NULL
cov: mask some warning about leakage
cleanup: better wording
tests: a bit more fancy way to initialized struct
gcc: avoid warns on missing braces with older version
gcc: avoid name colision with function pv_id() from metadata.h
tests: len always initialized
shellcheck: tests fixes
shellcheck: warning enhancements
clang: check for buffer existance
gcc-fanalyzer: helping understand answer is not null
gcc-fanalyzer: remove unneded zeroing
gcc-fanalyzer: zallocate memory for clean buffer
cov: ensuring buffer is zeroed
cov: check strchr for NULL
cov: check for function result
cov: sanitize function environment
cov: check dev_get_size result
cov: ignore leak of fd descriptor
tests: raise required version for conversion
make: generate
gcc: use more zero length arrays
gcc: match types
libdm: support DM_NAME_LIST_FLAG
devicemapper: add DM_NAME_LIST_FLAG
devicemapper: in sync with libdm
dmsetup: fix measure handling
metadata: remember crc32 when writing vg metadata
metadata: remember parsing size of VG metadata
metadata: optimize reading metadata copies in scan
metadata: avoid excessive check of /etc/localtime
cov: make more obvious buffer is zero ended
configure: check ffs __builtin_ffs versionsort
configure: replace AC_HELP_STRING with AS_
utils: define macro for ffs
make: fix compilation for some compiler
make: fix compilation for undefined RAID_INTERNAL
make: replace legacy use rindex with strrchr
make: opened can be needed for either defines case
make: build without versionsort
cov: ignoring
cov; matching enum type
cleanup: use first parameter uint
cleanup: reuse existing code for free path
cleanup: use already known lv size
debug: shorter code
metadata: simplify code
debug: fix stack tracing
metadata: enhance internal error
archiving: refactor code to allocate less memory
cleanup: remove unused code
cleanup: always initialize historical ptr
cleanup: all lvmcache_add users pass char with 0
cleanup: skip zeroing buffer overwritten by memcpy
cleanup: use dm_list_empty
archiving: update refactoring
debug: better error message
makefiles: use proper install prefix for python dbus
configure.ac: improvement
configure: updates
log: also build without systemd_journal_support
make: generate
debug: reduce some debugging noise
configure: missed braces
gcc: archive reoder struct vars
gcc: always initialize vg_complete
configure: bash var typo
unit-test: better check for O_DIRECT
makefile: enhance run-unit-test target
configure.ac: enhance systemd testing
configure: update
configure: fix use of withval
cov: avoid using NULL info
cov: validate subcommand existance
cov: ignore close result
cov: do not drop already known error state
cov: check pointer before dereferencing
cov: ensure id is always initialize
cov: check device_ids_write return code
dev-cache: skip different filesystems on dir scan
cleanup: use const char buffer
configure.ac: remove unused part
configure: update
dev-cache: better detection of filesystem
dev-cache: enhance dir scan also for non-udev build
1 year, 11 months
v2_03_14 tag - deleted
by Marian Csontos
tag: v2_03_14 - deleted with refnum:
tag v2_03_14
Release 2.03.14
- New udev autoactivation.
- vdoimport renamed to lvm_import_vdo.
- Add IMA support with 'dmsetup measure' command.
- Improved VDO support.
- New appmachineid option for global/system_id_source config option.
- New log/journal config option (and --journal CLI option)
- Many bug fixes, improvements, and clean ups.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAABAgAGBQJhb+qfAAoJELkRJDHlCQOfgVwP/0YuD/B/WbPvaq8ArfoCaWOO
dARd2coatQH9vBX8fw7S4hbV9EFNKCdgG8esMz3DIXq79OnR2awf6mAtUFQx7MMm
yYYd7kKzvULDM5Z5qKX6s+PAjdGo3R6/SAYKNq+acSZMzDpHs+1mNP5wp1tF1s9a
NK4f3MGYSKJW5ne09YZi9OEPQ6ku/MX/9uPo8UqwLAVReRFJkUeEsZDpjdVI/2AY
LOKuoxVZZypG/ixH5im41xpd8Roji6GG7P0n3ysdbIjy1hBnFR85gl6RaEN1nM+Q
HaiYhsqGB7WE4F0+0Dj4q1PnLMvX1NoHlliiqWlZYOoZkjTsSr5q8cZNgTTfAv8d
dhG69KSUgqyxl3FWXYqNMqrfCLSdZhgqMb2Z+xBIH3hI3SX9rEuxzw74ZbFdlqUW
YhCiv4ZU26Z0u5SBtpuK8STANZKsSm+tNL1Nh7sLrBJvMdWxbdI5D3joI87o0I+P
X8I89kOm9hwgfSSdqbxFI4hPMT54DqanCe/jkLZCbp+fI5ZQx8THlYjXTTHJRvdG
SMTHVm+7dObIWdsFDcJXHQ2eEVcBgabPljbxjSrWDBr4sIVzF24VVab80lTib37B
anRZgtGZglCGghrhP6Q7jjVtKPDWraQwLi9uK60gjTHkO6O/a91sMHWngerFixRD
zd2uqSo/i+6v+iIuKWIj
=vQTo
-----END PGP SIGNATURE-----
819a35cc9133889b5efc4833d8191e3e71396552 post-release
1 year, 11 months
v2_03_14 annotated tag has been created
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e38f017a9f929a01099...
Commit: e38f017a9f929a010995019bf9eadea229d28014
Parent: 0000000000000000000000000000000000000000
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: 2021-10-20 10:08 +0000
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: 2021-10-20 10:08 +0000
annotated tag: v2_03_14 has been created
at e38f017a9f929a010995019bf9eadea229d28014 (tag)
tagging 819a35cc9133889b5efc4833d8191e3e71396552 (commit)
replaces v2_03_13
Release 2.03.14
- New udev autoactivation.
- vdoimport renamed to lvm_import_vdo.
- Add IMA support with 'dmsetup measure' command.
- Improved VDO support.
- New appmachineid option for global/system_id_source config option.
- New log/journal config option (and --journal CLI option)
- Many bug fixes, improvements, and clean ups.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAABAgAGBQJhb+qfAAoJELkRJDHlCQOfgVwP/0YuD/B/WbPvaq8ArfoCaWOO
dARd2coatQH9vBX8fw7S4hbV9EFNKCdgG8esMz3DIXq79OnR2awf6mAtUFQx7MMm
yYYd7kKzvULDM5Z5qKX6s+PAjdGo3R6/SAYKNq+acSZMzDpHs+1mNP5wp1tF1s9a
NK4f3MGYSKJW5ne09YZi9OEPQ6ku/MX/9uPo8UqwLAVReRFJkUeEsZDpjdVI/2AY
LOKuoxVZZypG/ixH5im41xpd8Roji6GG7P0n3ysdbIjy1hBnFR85gl6RaEN1nM+Q
HaiYhsqGB7WE4F0+0Dj4q1PnLMvX1NoHlliiqWlZYOoZkjTsSr5q8cZNgTTfAv8d
dhG69KSUgqyxl3FWXYqNMqrfCLSdZhgqMb2Z+xBIH3hI3SX9rEuxzw74ZbFdlqUW
YhCiv4ZU26Z0u5SBtpuK8STANZKsSm+tNL1Nh7sLrBJvMdWxbdI5D3joI87o0I+P
X8I89kOm9hwgfSSdqbxFI4hPMT54DqanCe/jkLZCbp+fI5ZQx8THlYjXTTHJRvdG
SMTHVm+7dObIWdsFDcJXHQ2eEVcBgabPljbxjSrWDBr4sIVzF24VVab80lTib37B
anRZgtGZglCGghrhP6Q7jjVtKPDWraQwLi9uK60gjTHkO6O/a91sMHWngerFixRD
zd2uqSo/i+6v+iIuKWIj
=vQTo
-----END PGP SIGNATURE-----
Adrian Ratiu (1):
man-generator: initialize struct stat to avoid MSAN error
Alasdair G Kergon (1):
libdm: dmsetup measure support for IMA
Alex Xu (Hello71) (1):
add missing sys/file.h include
David Teigland (30):
toolcontext.h: use bit field in struct
cov: lvmlockd: rewrite string copies to avoid warnings
cov: clean up pvid and vgid usage
lvmdevices: check yes option for adding duplicate
tests: adjust for check_devicesfile
devices: apply ignorelockingfailure to devices file lock
logging: messages for found metadata
devices file: recognize old locking_type 0
vgimportclone: fix when duplicates are both in the devices file
devices: restrict device id types to specific major numbers
pvremove: apply devices file
cov: lvmlockd read_adopt_file free structs on error path
add --nohints option
lvmdevices: allow deviceidtype with addpvid
lvmcache: follow pv_id/pvid naming convention
lvmlockd: update error message
handle bad metadata text in vg_read path
device_id: update stacked PVs for vgchange uuid
config: comment all default settings
config: change default use_devicesfile to 1
system_id: new appmachineid option
pvscan: add options listlvs listvg checkcomplete
logging: to the systemd journal
new udev autoactivation
fix syslog setting
devices file: unmatching system id should just be warning
toollib: remove all devices list from process_each_pv
fix lvmcache_add log_debug pvid
fix segfault handling duplicate PVs
pvscan: only add device args to dev cache
Marian Csontos (8):
post-release
vdo: Rename vdoimport to lvm_import_vdo.
spec: Rename vdoimport to lvm_import_vdo.
configure: update
make: generate
WHATS_NEW: update
pre-release
post-release
Vojtech Trefny (1):
lvmdbusd: Use ID_FS_TYPE UDev property in udevwatch
Wu Guanghao (1):
cmdlib_lvm2_init: release cmd on failure path
Yi Wang (1):
lvchange: fix lvchange refresh failed for dm suspend or resume failed
Zdenek Kabelac (157):
vdo: rename vdoimport to lvm_import_vdo
vdo: skip zeroing for VDO LV
vdo: fix conversion of large virtual sizes
vdo: support lvcreate with skipped activation
vdo: fixes
makefiles: sanitize environment
tests: remove all debug logs when using die
vdo: add support for auto-unsafe writePolicy
vdo: lvm_import_vdo fix max_discard size
vdo: better message for missing device
vdo: more lvm_import_vdo fixes
vdo: read new sysfs path
tests: check lvm2 parses vdo statistics
vdo: lvm_import_vdo script needs to continue when vgname does not exist
vdo: man page updates
vdo: prompt with no return failure
filters: fix memleak on mpath filter destroy
cache: fix parentheses for migration_threshold
cache: filter out unsupported policy settings
cache: implement better revert path
libdm: enhance tracking of activated LVs
tests: add test for handling unknown cache settings
tests: increase size of thin-pool for newer mkfs
cov: fix copy from tmp_name buffer
cov: do not try to change passed in argv
cov: keep 64bit arithmetic
cov: keep time calculation ready for 2038
cov: initialize attr
cov: initilized more struct members
cov: add some initializers
cov: hide false positive warning
cov: make it aware we need these headers for muslC
cov: remove unused variable setting
gcc: remove invalid attribute
gcc: remove unused vg setting
clang: avoid double free on error path
clang: keep final_opts_list initialized for all paths
clang: keep metaname initialized
clang: free on arg parsing
cleanup: free already does NULL check
debug: change message level
lvm_import_vdo: --dry-run automatically verbose
cleanup: typo fix
lvmlockd: better error path
clang: add explicit test for VG
clang: ensure new_len is at least 1
gcc-fanalyzer: notices 'du' could be NULL
gcc-fanalyzer: explicit test null not pass
gcc-fanalyzer: use zeroed memory
gcc-fanalyzer: add extra check for origin_from_cow
gcc-fanalyzer: better losetup error path
gcc-fanalyzer: some explicit NULL checks for tests
gcc-fanalyzer: rewrite _fetch_string
gcc-fanalyzer: drop zeroing of pointers
tests: fix test of read buffer
tests: use single funtion to get random value
cov: pvck validates setup_device return value
cov: add error path for daemon_request_extend
cov: check fid instance is created
cov: handle teoretical sysconf failure
cov: better handle reallocation of adapt_file
cov: use different variable name
cov: handle better leak reports
cov: ensure data is not derefenced
cov: check for possible NULL segtype
cov: make read buffer obviously zero ended
cov: add explicit NULL pointer check
cov: better defined constructors
cov: capture runtime exception
cov: test for fixture being NULL pointer
cov: validate syscall result
cov: ignore syscall
cov: hide reports from optarg being NULL
cov: mask some warning about leakage
cleanup: better wording
tests: a bit more fancy way to initialized struct
gcc: avoid warns on missing braces with older version
gcc: avoid name colision with function pv_id() from metadata.h
tests: len always initialized
shellcheck: tests fixes
shellcheck: warning enhancements
clang: check for buffer existance
gcc-fanalyzer: helping understand answer is not null
gcc-fanalyzer: remove unneded zeroing
gcc-fanalyzer: zallocate memory for clean buffer
cov: ensuring buffer is zeroed
cov: check strchr for NULL
cov: check for function result
cov: sanitize function environment
cov: check dev_get_size result
cov: ignore leak of fd descriptor
tests: raise required version for conversion
make: generate
gcc: use more zero length arrays
gcc: match types
libdm: support DM_NAME_LIST_FLAG
devicemapper: add DM_NAME_LIST_FLAG
devicemapper: in sync with libdm
dmsetup: fix measure handling
metadata: remember crc32 when writing vg metadata
metadata: remember parsing size of VG metadata
metadata: optimize reading metadata copies in scan
metadata: avoid excessive check of /etc/localtime
cov: make more obvious buffer is zero ended
configure: check ffs __builtin_ffs versionsort
configure: replace AC_HELP_STRING with AS_
utils: define macro for ffs
make: fix compilation for some compiler
make: fix compilation for undefined RAID_INTERNAL
make: replace legacy use rindex with strrchr
make: opened can be needed for either defines case
make: build without versionsort
cov: ignoring
cov; matching enum type
cleanup: use first parameter uint
cleanup: reuse existing code for free path
cleanup: use already known lv size
debug: shorter code
metadata: simplify code
debug: fix stack tracing
metadata: enhance internal error
archiving: refactor code to allocate less memory
cleanup: remove unused code
cleanup: always initialize historical ptr
cleanup: all lvmcache_add users pass char with 0
cleanup: skip zeroing buffer overwritten by memcpy
cleanup: use dm_list_empty
archiving: update refactoring
debug: better error message
makefiles: use proper install prefix for python dbus
configure.ac: improvement
configure: updates
log: also build without systemd_journal_support
make: generate
debug: reduce some debugging noise
configure: missed braces
gcc: archive reoder struct vars
gcc: always initialize vg_complete
configure: bash var typo
unit-test: better check for O_DIRECT
makefile: enhance run-unit-test target
configure.ac: enhance systemd testing
configure: update
configure: fix use of withval
cov: avoid using NULL info
cov: validate subcommand existance
cov: ignore close result
cov: do not drop already known error state
cov: check pointer before dereferencing
cov: ensure id is always initialize
cov: check device_ids_write return code
dev-cache: skip different filesystems on dir scan
cleanup: use const char buffer
configure.ac: remove unused part
configure: update
dev-cache: better detection of filesystem
dev-cache: enhance dir scan also for non-udev build
1 year, 11 months
main - post-release
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=819a35cc9133889b5ef...
Commit: 819a35cc9133889b5efc4833d8191e3e71396552
Parent: ef4521831d15a1785e034f6c6f536a03446f6e05
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Oct 20 11:13:28 2021 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Oct 20 11:13:28 2021 +0200
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 0a3618042..dfbf5a300 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.03.14(2) (2021-10-20)
+2.03.15(2)-git (2021-10-20)
diff --git a/VERSION_DM b/VERSION_DM
index 52cb6225f..5e5c70a77 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.181 (2021-10-20)
+1.02.183-git (2021-10-20)
diff --git a/WHATS_NEW b/WHATS_NEW
index 240234e4d..b0720cd10 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.03.15 -
+===================================
+
Version 2.03.14 - 20th October 2021
===================================
Device scanning is skipping directories on different filesystems.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index adfff2142..8e06ee9b9 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.183 -
+====================================
+
Version 1.02.181 - 20th October 2021
====================================
Add IMA support with 'dmsetup measure' command.
1 year, 11 months
main - pre-release
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ef4521831d15a1785e0...
Commit: ef4521831d15a1785e034f6c6f536a03446f6e05
Parent: 36be4d68f68d71173fed528f2f377c600f68f724
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Oct 20 11:11:41 2021 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Oct 20 11:12:39 2021 +0200
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 4 ++--
WHATS_NEW_DM | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index b421d79ee..0a3618042 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.03.14(2)-git (2021-08-11)
+2.03.14(2) (2021-10-20)
diff --git a/VERSION_DM b/VERSION_DM
index b8c51d0b6..52cb6225f 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.181-git (2021-08-11)
+1.02.181 (2021-10-20)
diff --git a/WHATS_NEW b/WHATS_NEW
index 28e605280..240234e4d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.03.14 -
-==================================
+Version 2.03.14 - 20th October 2021
+===================================
Device scanning is skipping directories on different filesystems.
Print info message with too many or too large archived files.
Reduce metadata readings during scanning phase.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index c7029e437..adfff2142 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.181 -
-===================================
+Version 1.02.181 - 20th October 2021
+====================================
Add IMA support with 'dmsetup measure' command.
Add defines DM_NAME_LIST_FLAG_HAS_UUID, DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID.
Enhance tracking of activated devices when preloading dm tree.
1 year, 11 months
main - WHATS_NEW: update
by Marian Csontos
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=36be4d68f68d71173fe...
Commit: 36be4d68f68d71173fed528f2f377c600f68f724
Parent: 33e47182f773c1a902b533580b63a803906de55d
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Wed Oct 20 11:08:36 2021 +0200
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Oct 20 11:10:37 2021 +0200
WHATS_NEW: update
---
WHATS_NEW | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0199c174e..28e605280 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,6 @@
Version 2.03.14 -
==================================
- Device scanning is skipping different filesystems.
+ Device scanning is skipping directories on different filesystems.
Print info message with too many or too large archived files.
Reduce metadata readings during scanning phase.
Optimize computation of crc32 check sum with multiple PVs.
@@ -8,7 +8,7 @@ Version 2.03.14 -
Filter out unsupported MQ/SMQ cache policy setting.
Fix memleak in mpath filter.
Support newer location for VDO statistics.
- Add support for VDO async-unsage write policy.
+ Add support for VDO async-unsafe write policy.
Improve lvm_import_vdo script.
Support VDO LV with lvcreate -ky.
Fix lvconvert for VDO LV bigger then 2T.
1 year, 11 months
main - pvscan: only add device args to dev cache
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=33e47182f773c1a902b...
Commit: 33e47182f773c1a902b533580b63a803906de55d
Parent: 60dc44b707149e31fa766885574484aa5172f498
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Oct 18 16:24:24 2021 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Oct 19 17:13:57 2021 -0500
pvscan: only add device args to dev cache
Optimize the common pvscan --cache command by only adding
the necessary devs to dev-cache.
---
lib/device/dev-cache.c | 204 ++++++++++++++++++++++++++++++++++++----
lib/device/dev-cache.h | 6 +-
lib/device/device_id.c | 27 ++++--
lib/device/device_id.h | 1 +
test/shell/devicesfile-basic.sh | 2 +-
tools/pvscan.c | 58 +++++++-----
6 files changed, 246 insertions(+), 52 deletions(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index c6e5f68cf..33b75a9a9 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1852,7 +1852,7 @@ int setup_devices_file(struct cmd_context *cmd)
* Add all system devices to dev-cache, and attempt to
* match all devices_file entries to dev-cache entries.
*/
-static int _setup_devices(struct cmd_context *cmd, int no_file_match)
+int setup_devices(struct cmd_context *cmd)
{
int file_exists;
int lock_mode = 0;
@@ -1979,13 +1979,6 @@ static int _setup_devices(struct cmd_context *cmd, int no_file_match)
*/
dev_cache_scan(cmd);
- /*
- * The caller uses "no_file_match" if it wants to match specific devs
- * itself, instead of matching everything in device_ids_match.
- */
- if (no_file_match && cmd->enable_devices_file)
- return 1;
-
/*
* Match entries from cmd->use_devices with device structs in dev-cache.
*/
@@ -1994,16 +1987,6 @@ static int _setup_devices(struct cmd_context *cmd, int no_file_match)
return 1;
}
-int setup_devices(struct cmd_context *cmd)
-{
- return _setup_devices(cmd, 0);
-}
-
-int setup_devices_no_file_match(struct cmd_context *cmd)
-{
- return _setup_devices(cmd, 1);
-}
-
/*
* The alternative to setup_devices() when the command is interested
* in using only one PV.
@@ -2072,3 +2055,188 @@ int setup_device(struct cmd_context *cmd, const char *devname)
return 1;
}
+/*
+ * pvscan --cache is specialized/optimized to look only at command args,
+ * so this just sets up the devices file, then individual devices are
+ * added to dev-cache and matched with device_ids later in pvscan.
+ */
+
+int setup_devices_for_pvscan_cache(struct cmd_context *cmd)
+{
+ if (cmd->enable_devices_list) {
+ if (!_setup_devices_list(cmd))
+ return_0;
+ return 1;
+ }
+
+ if (!setup_devices_file(cmd))
+ return_0;
+
+ if (!cmd->enable_devices_file)
+ return 1;
+
+ if (!devices_file_exists(cmd)) {
+ log_debug("Devices file not found, ignoring.");
+ cmd->enable_devices_file = 0;
+ return 1;
+ }
+
+ if (!lock_devices_file(cmd, LOCK_SH)) {
+ log_error("Failed to lock the devices file to read.");
+ return 0;
+ }
+
+ if (!device_ids_read(cmd)) {
+ log_error("Failed to read the devices file.");
+ unlock_devices_file(cmd);
+ return 0;
+ }
+
+ unlock_devices_file(cmd);
+ return 1;
+}
+
+
+/* Get a device name from a devno. */
+
+static char *_get_devname_from_devno(struct cmd_context *cmd, dev_t devno)
+{
+ char path[PATH_MAX];
+ char devname[PATH_MAX];
+ char namebuf[NAME_LEN];
+ char line[1024];
+ int major = MAJOR(devno);
+ int minor = MINOR(devno);
+ int line_major;
+ int line_minor;
+ uint64_t line_blocks;
+ DIR *dir;
+ struct dirent *dirent;
+ FILE *fp;
+
+ /*
+ * $ ls /sys/dev/block/8:0/device/block/
+ * sda
+ */
+ if (major_is_scsi_device(cmd->dev_types, major)) {
+ if (dm_snprintf(path, sizeof(path), "%sdev/block/%d:%d/device/block",
+ dm_sysfs_dir(), major, minor) < 0) {
+ return NULL;
+ }
+
+ if (!(dir = opendir(path)))
+ return NULL;
+
+ while ((dirent = readdir(dir))) {
+ if (dirent->d_name[0] == '.')
+ continue;
+ if (dm_snprintf(devname, sizeof(devname), "/dev/%s", dirent->d_name) < 0) {
+ devname[0] = '\0';
+ stack;
+ }
+ break;
+ }
+ closedir(dir);
+
+ if (devname[0]) {
+ log_debug("Found %s for %d:%d from sys", devname, major, minor);
+ return _strdup(devname);
+ }
+ return NULL;
+ }
+
+ /*
+ * $ cat /sys/dev/block/253:3/dm/name
+ * mpatha
+ */
+ if (major == cmd->dev_types->device_mapper_major) {
+ if (dm_snprintf(path, sizeof(path), "%sdev/block/%d:%d/dm/name",
+ dm_sysfs_dir(), major, minor) < 0) {
+ return NULL;
+ }
+
+ if (!get_sysfs_value(path, namebuf, sizeof(namebuf), 0))
+ return NULL;
+
+ if (dm_snprintf(devname, sizeof(devname), "/dev/mapper/%s", namebuf) < 0) {
+ devname[0] = '\0';
+ stack;
+ }
+
+ if (devname[0]) {
+ log_debug("Found %s for %d:%d from sys", devname, major, minor);
+ return _strdup(devname);
+ }
+ return NULL;
+ }
+
+ /*
+ * /proc/partitions lists
+ * major minor #blocks name
+ */
+
+ if (!(fp = fopen("/proc/partitions", "r")))
+ return NULL;
+
+ while (fgets(line, sizeof(line), fp)) {
+ if (sscanf(line, "%u %u %llu %s", &line_major, &line_minor, (unsigned long long *)&line_blocks, namebuf) != 4)
+ continue;
+ if (line_major != major)
+ continue;
+ if (line_minor != minor)
+ continue;
+
+ if (dm_snprintf(devname, sizeof(devname), "/dev/%s", namebuf) < 0) {
+ devname[0] = '\0';
+ stack;
+ }
+ break;
+ }
+ fclose(fp);
+
+ if (devname[0]) {
+ log_debug("Found %s for %d:%d from proc", devname, major, minor);
+ return _strdup(devname);
+ }
+
+ /*
+ * If necessary, this could continue searching by stat'ing /dev entries.
+ */
+
+ return NULL;
+}
+
+int setup_devname_in_dev_cache(struct cmd_context *cmd, const char *devname)
+{
+ struct stat buf;
+ struct device *dev;
+
+ if (stat(devname, &buf) < 0) {
+ log_error("Cannot access device %s.", devname);
+ return 0;
+ }
+
+ if (!S_ISBLK(buf.st_mode)) {
+ log_error("Invaild device type %s.", devname);
+ return 0;
+ }
+
+ if (!_insert_dev(devname, buf.st_rdev))
+ return_0;
+
+ if (!(dev = (struct device *) dm_hash_lookup(_cache.names, devname)))
+ return_0;
+
+ return 1;
+}
+
+int setup_devno_in_dev_cache(struct cmd_context *cmd, dev_t devno)
+{
+ const char *devname;
+
+ if (!(devname = _get_devname_from_devno(cmd, devno)))
+ return_0;
+
+ return setup_devname_in_dev_cache(cmd, devname);
+}
+
diff --git a/lib/device/dev-cache.h b/lib/device/dev-cache.h
index 635dc4fc9..143848d6d 100644
--- a/lib/device/dev-cache.h
+++ b/lib/device/dev-cache.h
@@ -77,7 +77,11 @@ int get_dm_uuid_from_sysfs(char *buf, size_t buf_size, int major, int minor);
int setup_devices_file(struct cmd_context *cmd);
int setup_devices(struct cmd_context *cmd);
-int setup_devices_no_file_match(struct cmd_context *cmd);
int setup_device(struct cmd_context *cmd, const char *devname);
+/* Normal device setup functions are split up for pvscan optimization. */
+int setup_devices_for_pvscan_cache(struct cmd_context *cmd);
+int setup_devname_in_dev_cache(struct cmd_context *cmd, const char *devname);
+int setup_devno_in_dev_cache(struct cmd_context *cmd, dev_t devno);
+
#endif
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index eb06109ff..167bf661b 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -1534,6 +1534,22 @@ int device_ids_match_dev(struct cmd_context *cmd, struct device *dev)
* passes the filter.
*/
+void device_ids_match_device_list(struct cmd_context *cmd)
+{
+ struct dev_use *du;
+
+ dm_list_iterate_items(du, &cmd->use_devices) {
+ if (du->dev)
+ continue;
+ if (!(du->dev = dev_cache_get(cmd, du->devname, NULL))) {
+ log_warn("Device not found for %s.", du->devname);
+ } else {
+ /* Should we set dev->id? Which idtype? Use --deviceidtype? */
+ du->dev->flags |= DEV_MATCHED_USE_ID;
+ }
+ }
+}
+
void device_ids_match(struct cmd_context *cmd)
{
struct dev_iter *iter;
@@ -1541,16 +1557,7 @@ void device_ids_match(struct cmd_context *cmd)
struct device *dev;
if (cmd->enable_devices_list) {
- dm_list_iterate_items(du, &cmd->use_devices) {
- if (du->dev)
- continue;
- if (!(du->dev = dev_cache_get(cmd, du->devname, NULL))) {
- log_warn("Device not found for %s.", du->devname);
- } else {
- /* Should we set dev->id? Which idtype? Use --deviceidtype? */
- du->dev->flags |= DEV_MATCHED_USE_ID;
- }
- }
+ device_ids_match_device_list(cmd);
return;
}
diff --git a/lib/device/device_id.h b/lib/device/device_id.h
index 939b3a0f4..0ada35c94 100644
--- a/lib/device/device_id.h
+++ b/lib/device/device_id.h
@@ -32,6 +32,7 @@ int device_id_add(struct cmd_context *cmd, struct device *dev, const char *pvid,
void device_id_pvremove(struct cmd_context *cmd, struct device *dev);
void device_ids_match(struct cmd_context *cmd);
int device_ids_match_dev(struct cmd_context *cmd, struct device *dev);
+void device_ids_match_device_list(struct cmd_context *cmd);
void device_ids_validate(struct cmd_context *cmd, struct dm_list *scanned_devs, int *device_ids_invalid, int noupdate);
int device_ids_version_unchanged(struct cmd_context *cmd);
void device_ids_find_renamed_devs(struct cmd_context *cmd, struct dm_list *dev_list, int *search_count, int noupdate);
diff --git a/test/shell/devicesfile-basic.sh b/test/shell/devicesfile-basic.sh
index 7ba9e2c7f..9c3455c76 100644
--- a/test/shell/devicesfile-basic.sh
+++ b/test/shell/devicesfile-basic.sh
@@ -283,7 +283,7 @@ not ls "$RUNDIR/lvm/pvs_online/$PVID3"
# arg in devices list
_clear_online_files
pvscan --devices "$dev3" --cache -aay "$dev3"
-pvscan --devices "$dev4" --cache -aay "$dev4"
+pvscan --devices "$dev4","$dev3" --cache -aay "$dev4"
check lv_field $vg2/$lv2 lv_active "active"
vgchange -an $vg2
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 8e2611361..95d593d57 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -857,11 +857,21 @@ static int _get_devs_from_saved_vg(struct cmd_context *cmd, const char *vgname,
devno = MKDEV(file_major, file_minor);
+ if (!setup_devno_in_dev_cache(cmd, devno)) {
+ log_error_pvscan(cmd, "No device set up for %d:%d PVID %s", file_major, file_minor, pvid);
+ goto bad;
+ }
+
if (!(dev = dev_cache_get_by_devt(cmd, devno, NULL, NULL))) {
log_error_pvscan(cmd, "No device found for %d:%d PVID %s", file_major, file_minor, pvid);
goto bad;
}
+ /*
+ * Do not need to match device_id here, see comment after
+ * get_devs_from_saved_vg about relying on pvid online file.
+ */
+
name1 = dev_name(dev);
name2 = pvl->pv->device_hint;
@@ -1099,17 +1109,11 @@ static int _pvscan_aa(struct cmd_context *cmd, struct pvscan_aa_params *pp,
* PROCESS_SKIP_SCAN: we have already done lvmcache_label_scan
* so tell process_each to skip it.
*/
- if (do_all)
- read_flags |= PROCESS_SKIP_SCAN;
- /*
- * When the command is processing specific devs (not all), it
- * has done setup_devices_no_file_match() to avoid matching ids
- * fo all devs unnecessarily, but now that we're falling back
- * to process_each_vg() we need to complete the id matching.
- */
if (!do_all)
- device_ids_match(cmd);
+ lvmcache_label_scan(cmd);
+
+ read_flags |= PROCESS_SKIP_SCAN;
ret = process_each_vg(cmd, 0, NULL, NULL, vgnames, read_flags, 0, handle, _pvscan_aa_single);
}
@@ -1192,11 +1196,15 @@ static int _get_args_devs(struct cmd_context *cmd, struct dm_list *pvscan_args,
/* in common usage, no dev will be found for a devno */
dm_list_iterate_items(arg, pvscan_args) {
- if (arg->devname)
+ if (arg->devname) {
+ if (!setup_devname_in_dev_cache(cmd, arg->devname))
+ log_error_pvscan(cmd, "No device set up for name arg %s", arg->devname);
arg->dev = dev_cache_get(cmd, arg->devname, NULL);
- else if (arg->devno)
+ } else if (arg->devno) {
+ if (!setup_devno_in_dev_cache(cmd, arg->devno))
+ log_error_pvscan(cmd, "No device set up for devno arg %d", (int)arg->devno);
arg->dev = dev_cache_get_by_devt(cmd, arg->devno, NULL, NULL);
- else
+ } else
return_0;
}
@@ -1672,11 +1680,13 @@ static int _pvscan_cache_args(struct cmd_context *cmd, int argc, char **argv,
cmd->pvscan_cache_single = 1;
/*
- * "no_file_match" means that when the devices file is used,
- * setup_devices will skip matching devs to devices file entries.
- * Specific devs must be matched later with device_ids_match_dev().
+ * Special pvscan-specific setup steps to avoid looking
+ * at any devices except for device args.
+ * Read devices file and determine if devices file will be used.
+ * Does not do dev_cache_scan (adds nothing to dev-cache), and
+ * does not do any device id matching.
*/
- if (!setup_devices_no_file_match(cmd)) {
+ if (!setup_devices_for_pvscan_cache(cmd)) {
log_error_pvscan(cmd, "Failed to set up devices.");
return 0;
}
@@ -1735,17 +1745,21 @@ static int _pvscan_cache_args(struct cmd_context *cmd, int argc, char **argv,
log_debug("pvscan_cache_args: filter devs nodata");
/*
- * Match dev args with the devices file because
- * setup_devices_no_file_match() was used above which skipped checking
- * the devices file. If a match fails here do not exclude it, that
- * will be done below by passes_filter() which runs filter-deviceid.
- * The relax_deviceid_filter case needs to be able to work around
+ * Match dev args with the devices file because special/optimized
+ * device setup was used above which does not check the devices file.
+ * If a match fails here do not exclude it, that will be done below by
+ * passes_filter() which runs filter-deviceid. The
+ * relax_deviceid_filter case needs to be able to work around
* unmatching devs.
*/
+
if (cmd->enable_devices_file) {
- dm_list_iterate_items_safe(devl, devl2, &pvscan_devs)
+ dm_list_iterate_items(devl, &pvscan_devs)
device_ids_match_dev(cmd, devl->dev);
+
}
+ if (cmd->enable_devices_list)
+ device_ids_match_device_list(cmd);
if (cmd->enable_devices_file && device_ids_use_devname(cmd)) {
relax_deviceid_filter = 1;
1 year, 11 months