main - dev-cache: enhance dir scan also for non-udev build
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=60dc44b707149e31fa7...
Commit: 60dc44b707149e31fa766885574484aa5172f498
Parent: 88e0d68909c007576272d65216b0e7a9011b9c9b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 18 21:50:56 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 18 21:50:56 2021 +0200
dev-cache: enhance dir scan also for non-udev build
---
lib/device/dev-cache.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 57fa916a9..c6e5f68cf 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1099,9 +1099,17 @@ static int _device_in_udev_db(const dev_t d)
static void _insert_dirs(struct dm_list *dirs)
{
struct dir_list *dl;
+ struct stat tinfo;
- dm_list_iterate_items(dl, &_cache.dirs)
+ dm_list_iterate_items(dl, &_cache.dirs) {
+ if (stat(dl->dir, &tinfo) < 0) {
+ log_warn("WARNING: Cannot use dir %s, %s.",
+ dl->dir, strerror(errno));
+ continue;
+ }
+ _cache.st_dev = tinfo.st_dev;
_insert_dir(dl->dir);
+ }
}
#endif /* UDEV_SYNC_SUPPORT */
2 years, 6 months
main - dev-cache: better detection of filesystem
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=88e0d68909c00757627...
Commit: 88e0d68909c007576272d65216b0e7a9011b9c9b
Parent: c60bac466175949b56b768b5e8d01ea5655a423e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 18 21:08:19 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 18 21:16:53 2021 +0200
dev-cache: better detection of filesystem
It appear on some systems the first found dev might not be actually for
the filesytem - so use a better way through _cache.st_dev.
---
lib/device/dev-cache.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 6d706eb1e..57fa916a9 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -53,6 +53,7 @@ static struct {
const char *dev_dir;
int has_scanned;
+ long st_dev;
struct dm_list dirs;
struct dm_list files;
@@ -1064,11 +1065,18 @@ static void _insert_dirs(struct dm_list *dirs)
struct dir_list *dl;
struct udev *udev = NULL;
int with_udev;
+ struct stat tinfo;
with_udev = obtain_device_list_from_udev() &&
(udev = udev_get_library_context());
dm_list_iterate_items(dl, &_cache.dirs) {
+ if (stat(dl->dir, &tinfo) < 0) {
+ log_warn("WARNING: Cannot use dir %s, %s.",
+ dl->dir, strerror(errno));
+ continue;
+ }
+ _cache.st_dev = tinfo.st_dev;
if (with_udev) {
if (!_insert_udev_dir(udev, dl->dir))
log_debug_devs("%s: Failed to insert devices from "
@@ -1101,7 +1109,6 @@ static void _insert_dirs(struct dm_list *dirs)
static int _insert(const char *path, const struct stat *info,
int rec, int check_with_udev_db)
{
- static long _st_dev = -1;
struct stat tinfo;
if (!info) {
@@ -1112,20 +1119,12 @@ static int _insert(const char *path, const struct stat *info,
info = &tinfo;
}
- if (_st_dev == -1)
- _st_dev = info->st_dev; /* first dir device */
-
if (check_with_udev_db && !_device_in_udev_db(info->st_rdev)) {
log_very_verbose("%s: Not in udev db", path);
return 0;
}
if (S_ISDIR(info->st_mode)) { /* add a directory */
- if (info->st_dev != _st_dev) {
- log_debug_devs("%s: Different filesystem in directory", path);
- return 1;
- }
-
/* check it's not a symbolic link */
if (lstat(path, &tinfo) < 0) {
log_sys_very_verbose("lstat", path);
@@ -1137,6 +1136,11 @@ static int _insert(const char *path, const struct stat *info,
return 1;
}
+ if (info->st_dev != _cache.st_dev) {
+ log_debug_devs("%s: Different filesystem in directory", path);
+ return 1;
+ }
+
if (rec && !_insert_dir(path))
return 0;
} else { /* add a device */
2 years, 6 months
main - configure: update
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c60bac466175949b56b...
Commit: c60bac466175949b56b768b5e8d01ea5655a423e
Parent: 1b104ddb5539f998389afa3394cbc81d9410b390
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 18 19:13:58 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 18 19:17:27 2021 +0200
configure: update
---
configure | 116 +++++++++----------------------------------------
include/configure.h.in | 3 --
2 files changed, 21 insertions(+), 98 deletions(-)
diff --git a/configure b/configure
index 5719be836..cfad36e51 100755
--- a/configure
+++ b/configure
@@ -773,10 +773,10 @@ PYTHON
LVM2CMD_LIB
UDEV_LIBS
UDEV_CFLAGS
-SYSTEMD_LIBS
-SYSTEMD_CFLAGS
BLKID_LIBS
BLKID_CFLAGS
+SYSTEMD_LIBS
+SYSTEMD_CFLAGS
LOCKD_IDM_LIBS
LOCKD_IDM_CFLAGS
LOCKD_DLM_CONTROL_LIBS
@@ -964,7 +964,6 @@ enable_udev_systemd_background_jobs
enable_udev_sync
enable_udev_rules
enable_udev_rule_exec_detection
-enable_compat
enable_units_compat
enable_ioctl
enable_o_direct
@@ -1029,10 +1028,10 @@ LOCKD_DLM_CONTROL_CFLAGS
LOCKD_DLM_CONTROL_LIBS
LOCKD_IDM_CFLAGS
LOCKD_IDM_LIBS
-BLKID_CFLAGS
-BLKID_LIBS
SYSTEMD_CFLAGS
SYSTEMD_LIBS
+BLKID_CFLAGS
+BLKID_LIBS
UDEV_CFLAGS
UDEV_LIBS
PYTHON
@@ -1705,7 +1704,6 @@ Optional Features:
--enable-udev_rules install rule files needed for udev synchronisation
--enable-udev-rule-exec-detection
enable executable path detection in udev rules
- --enable-compat enable support for old device-mapper versions
--enable-units-compat enable output compatibility with old versions that
that do not use KiB-style unit suffixes
--disable-ioctl disable ioctl calls to device-mapper in the kernel
@@ -1853,13 +1851,13 @@ Some influential environment variables:
C compiler flags for LOCKD_IDM, overriding pkg-config
LOCKD_IDM_LIBS
linker flags for LOCKD_IDM, overriding pkg-config
- BLKID_CFLAGS
- C compiler flags for BLKID, overriding pkg-config
- BLKID_LIBS linker flags for BLKID, overriding pkg-config
SYSTEMD_CFLAGS
C compiler flags for SYSTEMD, overriding pkg-config
SYSTEMD_LIBS
linker flags for SYSTEMD, overriding pkg-config
+ BLKID_CFLAGS
+ C compiler flags for BLKID, overriding pkg-config
+ BLKID_LIBS linker flags for BLKID, overriding pkg-config
UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
UDEV_LIBS linker flags for UDEV, overriding pkg-config
PYTHON the Python interpreter
@@ -3142,10 +3140,6 @@ case "$host_os" in
LIB_SUFFIX=so
DEVMAPPER=yes
BUILD_LVMPOLLD=no
- LOCKDSANLOCK=no
- LOCKDDLM=no
- LOCKDDLM_CONTROL=no
- LOCKDIDM=no
ODIRECT=yes
DM_IOCTLS=yes
SELINUX=yes
@@ -8471,6 +8465,7 @@ if test "${with_default_use_devices_file+set}" = set; then :
else
DEFAULT_USE_DEVICES_FILE=0
fi
+
case "$DEFAULT_USE_DEVICES_FILE" in
0|1);;
*) as_fn_error $? "--with-default-use-devices-file parameter invalid" "$LINENO" 5;;
@@ -11000,6 +10995,8 @@ $as_echo_n "checking whether to build lvmpolld... " >&6; }
# Check whether --enable-lvmpolld was given.
if test "${enable_lvmpolld+set}" = set; then :
enableval=$enable_lvmpolld; LVMPOLLD=$enableval
+else
+ LVMPOLLD=no
fi
test -n "$LVMPOLLD" && BUILD_LVMPOLLD=$LVMPOLLD
@@ -11014,6 +11011,8 @@ $as_echo_n "checking whether to build lvmlockdsanlock... " >&6; }
# Check whether --enable-lvmlockd-sanlock was given.
if test "${enable_lvmlockd_sanlock+set}" = set; then :
enableval=$enable_lvmlockd_sanlock; LOCKDSANLOCK=$enableval
+else
+ LOCKDSANLOCK=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LOCKDSANLOCK" >&5
@@ -11105,6 +11104,8 @@ $as_echo_n "checking whether to build lvmlockddlm... " >&6; }
# Check whether --enable-lvmlockd-dlm was given.
if test "${enable_lvmlockd_dlm+set}" = set; then :
enableval=$enable_lvmlockd_dlm; LOCKDDLM=$enableval
+else
+ LOCKDDLM=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LOCKDDLM" >&5
@@ -11196,6 +11197,8 @@ $as_echo_n "checking whether to build lvmlockddlmcontrol... " >&6; }
# Check whether --enable-lvmlockd-dlmcontrol was given.
if test "${enable_lvmlockd_dlmcontrol+set}" = set; then :
enableval=$enable_lvmlockd_dlmcontrol; LOCKDDLM_CONTROL=$enableval
+else
+ LOCKDDLM_CONTROL=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LOCKDDLM_CONTROL" >&5
@@ -11287,6 +11290,8 @@ $as_echo_n "checking whether to build lvmlockdidm... " >&6; }
# Check whether --enable-lvmlockd-idm was given.
if test "${enable_lvmlockd_idm+set}" = set; then :
enableval=$enable_lvmlockd_idm; LOCKDIDM=$enableval
+else
+ LOCKDIDM=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LOCKDIDM" >&5
@@ -11366,76 +11371,15 @@ else
$as_echo "yes" >&6; }
HAVE_LOCKD_IDM=yes
fi
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLKID" >&5
-$as_echo_n "checking for BLKID... " >&6; }
-
-if test -n "$BLKID_CFLAGS"; then
- pkg_cv_BLKID_CFLAGS="$BLKID_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
+ if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"blkid >= 2.24\""; } >&5
($PKG_CONFIG --exists --print-errors "blkid >= 2.24") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_BLKID_CFLAGS=`$PKG_CONFIG --cflags "blkid >= 2.24" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
+ HAVE_LOCKD_IDM=yes
else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$BLKID_LIBS"; then
- pkg_cv_BLKID_LIBS="$BLKID_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"blkid >= 2.24\""; } >&5
- ($PKG_CONFIG --exists --print-errors "blkid >= 2.24") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- pkg_cv_BLKID_LIBS=`$PKG_CONFIG --libs "blkid >= 2.24" 2>/dev/null`
- test "x$?" != "x0" && pkg_failed=yes
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- BLKID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "blkid >= 2.24" 2>&1`
- else
- BLKID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "blkid >= 2.24" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$BLKID_PKG_ERRORS" >&5
-
- $bailout
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- $bailout
-else
- BLKID_CFLAGS=$pkg_cv_BLKID_CFLAGS
- BLKID_LIBS=$pkg_cv_BLKID_LIBS
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- HAVE_LOCKD_IDM=yes
+ $bailout
fi
$as_echo "#define LOCKDIDM_SUPPORT 1" >>confdefs.h
@@ -12085,24 +12029,6 @@ $as_echo_n "checking whether udev supports built-in blkid... " >&6; }
$as_echo "$UDEV_HAS_BUILTIN_BLKID" >&6; }
fi
-################################################################################
-# Check whether --enable-compat was given.
-if test "${enable_compat+set}" = set; then :
- enableval=$enable_compat; DM_COMPAT=$enableval
-else
- DM_COMPAT=no
-fi
-
-
-if test "$DM_COMPAT" = yes; then :
-
-$as_echo "#define DM_COMPAT 1" >>confdefs.h
-
- as_fn_error $? "--enable-compat is not currently supported.
-Since device-mapper version 1.02.66, only one version (4) of the device-mapper
-ioctl protocol is supported." "$LINENO" 5
-fi
-
################################################################################
# Check whether --enable-units-compat was given.
if test "${enable_units_compat+set}" = set; then :
diff --git a/include/configure.h.in b/include/configure.h.in
index 7efa83661..e0d971bbf 100644
--- a/include/configure.h.in
+++ b/include/configure.h.in
@@ -114,9 +114,6 @@
/* Define to 1 to enable the device-mapper filemap daemon. */
#undef DMFILEMAPD
-/* Define to enable compat protocol */
-#undef DM_COMPAT
-
/* Define default group for device node */
#undef DM_DEVICE_GID
2 years, 6 months
main - configure.ac: remove unused part
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1b104ddb5539f998389...
Commit: 1b104ddb5539f998389afa3394cbc81d9410b390
Parent: a172a02a9a980d084d5729cc8483bdddad0100f2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Oct 16 22:08:50 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 18 19:17:27 2021 +0200
configure.ac: remove unused part
As we are not using 'enable-compat' for anything, remove this section.
Also remove duplicated check for blkid.
Move setting of some AC_ARG_ENABLE defaults into the macro so it's always
defined.
---
configure.ac | 29 ++++++-----------------------
1 file changed, 6 insertions(+), 23 deletions(-)
diff --git a/configure.ac b/configure.ac
index 2f821edae..6cdf1a7e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,10 +38,6 @@ case "$host_os" in
LIB_SUFFIX=so
DEVMAPPER=yes
BUILD_LVMPOLLD=no
- LOCKDSANLOCK=no
- LOCKDDLM=no
- LOCKDDLM_CONTROL=no
- LOCKDIDM=no
ODIRECT=yes
DM_IOCTLS=yes
SELINUX=yes
@@ -946,7 +942,7 @@ AC_MSG_CHECKING(whether to build lvmpolld)
AC_ARG_ENABLE(lvmpolld,
AS_HELP_STRING([--enable-lvmpolld],
[enable the LVM Polling Daemon]),
- LVMPOLLD=$enableval)
+ LVMPOLLD=$enableval, LVMPOLLD=no)
test -n "$LVMPOLLD" && BUILD_LVMPOLLD=$LVMPOLLD
AC_MSG_RESULT($BUILD_LVMPOLLD)
@@ -958,7 +954,7 @@ AC_MSG_CHECKING(whether to build lvmlockdsanlock)
AC_ARG_ENABLE(lvmlockd-sanlock,
AS_HELP_STRING([--enable-lvmlockd-sanlock],
[enable the LVM lock daemon using sanlock]),
- LOCKDSANLOCK=$enableval)
+ LOCKDSANLOCK=$enableval, LOCKDSANLOCK=no)
AC_MSG_RESULT($LOCKDSANLOCK)
BUILD_LOCKDSANLOCK=$LOCKDSANLOCK
@@ -976,7 +972,7 @@ AC_MSG_CHECKING(whether to build lvmlockddlm)
AC_ARG_ENABLE(lvmlockd-dlm,
AS_HELP_STRING([--enable-lvmlockd-dlm],
[enable the LVM lock daemon using dlm]),
- LOCKDDLM=$enableval)
+ LOCKDDLM=$enableval, LOCKDDLM=no)
AC_MSG_RESULT($LOCKDDLM)
BUILD_LOCKDDLM=$LOCKDDLM
@@ -994,7 +990,7 @@ AC_MSG_CHECKING(whether to build lvmlockddlmcontrol)
AC_ARG_ENABLE(lvmlockd-dlmcontrol,
AS_HELP_STRING([--enable-lvmlockd-dlmcontrol],
[enable lvmlockd remote refresh using libdlmcontrol]),
- LOCKDDLM_CONTROL=$enableval)
+ LOCKDDLM_CONTROL=$enableval, LOCKDDLM_CONTROL=no)
AC_MSG_RESULT($LOCKDDLM_CONTROL)
BUILD_LOCKDDLM_CONTROL=$LOCKDDLM_CONTROL
@@ -1012,7 +1008,7 @@ AC_MSG_CHECKING(whether to build lvmlockdidm)
AC_ARG_ENABLE(lvmlockd-idm,
AS_HELP_STRING([--enable-lvmlockd-idm],
[enable the LVM lock daemon using idm]),
- LOCKDIDM=$enableval)
+ LOCKDIDM=$enableval, LOCKDIDM=no)
AC_MSG_RESULT($LOCKDIDM)
BUILD_LOCKDIDM=$LOCKDIDM
@@ -1020,7 +1016,7 @@ BUILD_LOCKDIDM=$LOCKDIDM
dnl -- Look for Seagate IDM libraries
if test "$BUILD_LOCKDIDM" = yes; then
PKG_CHECK_MODULES(LOCKD_IDM, libseagate_ilm >= 0.1.0, [HAVE_LOCKD_IDM=yes], $bailout)
- PKG_CHECK_MODULES(BLKID, blkid >= 2.24, [HAVE_LOCKD_IDM=yes], $bailout)
+ PKG_CHECK_EXISTS(blkid >= 2.24, [HAVE_LOCKD_IDM=yes], $bailout)
AC_DEFINE([LOCKDIDM_SUPPORT], 1, [Define to 1 to include code that uses lvmlockd IDM option.])
BUILD_LVMLOCKD=yes
fi
@@ -1251,19 +1247,6 @@ if test "$UDEV_RULE" != no ; then
AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID)
fi
-################################################################################
-dnl -- Compatibility mode
-AC_ARG_ENABLE(compat,
- AS_HELP_STRING([--enable-compat],
- [enable support for old device-mapper versions]),
- DM_COMPAT=$enableval, DM_COMPAT=no)
-
-AS_IF([test "$DM_COMPAT" = yes],
- [AC_DEFINE([DM_COMPAT], 1, [Define to enable compat protocol])
- AC_MSG_ERROR([--enable-compat is not currently supported.
-Since device-mapper version 1.02.66, only one version (4) of the device-mapper
-ioctl protocol is supported.])])
-
################################################################################
dnl -- Compatible units suffix mode
AC_ARG_ENABLE(units-compat,
2 years, 6 months
main - cleanup: use const char buffer
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a172a02a9a980d084d5...
Commit: a172a02a9a980d084d5729cc8483bdddad0100f2
Parent: 9cf4eac250ef7abd5e0961da2371294da07ab4de
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Oct 16 10:09:02 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 18 19:17:27 2021 +0200
cleanup: use const char buffer
---
lib/locking/lvmlockd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index 4f9952d5b..b598df3d6 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -503,7 +503,7 @@ static int _create_sanlock_lv(struct cmd_context *cmd, struct volume_group *vg,
.read_ahead = DM_READ_AHEAD_NONE,
.stripes = 1,
.vg_name = vg->name,
- .lv_name = dm_pool_strdup(cmd->mem, lock_lv_name),
+ .lv_name = lock_lv_name,
.zero = 1,
};
2 years, 6 months
main - dev-cache: skip different filesystems on dir scan
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9cf4eac250ef7abd5e0...
Commit: 9cf4eac250ef7abd5e0961da2371294da07ab4de
Parent: bae1083472d9c589d59f93a4e0a137cb94ba5ed0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Oct 18 19:04:44 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Oct 18 19:17:26 2021 +0200
dev-cache: skip different filesystems on dir scan
When scanning configured /dev dir, avoid entring
directories with different filesystem.
This minimizes risk we will block on i.e. entring
directory with mount point.
---
WHATS_NEW | 1 +
lib/device/dev-cache.c | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index d87cb7e37..0199c174e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.14 -
==================================
+ Device scanning is skipping 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.
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index d454b5b30..6d706eb1e 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1101,6 +1101,7 @@ static void _insert_dirs(struct dm_list *dirs)
static int _insert(const char *path, const struct stat *info,
int rec, int check_with_udev_db)
{
+ static long _st_dev = -1;
struct stat tinfo;
if (!info) {
@@ -1111,12 +1112,20 @@ static int _insert(const char *path, const struct stat *info,
info = &tinfo;
}
+ if (_st_dev == -1)
+ _st_dev = info->st_dev; /* first dir device */
+
if (check_with_udev_db && !_device_in_udev_db(info->st_rdev)) {
log_very_verbose("%s: Not in udev db", path);
return 0;
}
if (S_ISDIR(info->st_mode)) { /* add a directory */
+ if (info->st_dev != _st_dev) {
+ log_debug_devs("%s: Different filesystem in directory", path);
+ return 1;
+ }
+
/* check it's not a symbolic link */
if (lstat(path, &tinfo) < 0) {
log_sys_very_verbose("lstat", path);
2 years, 6 months
main - cov: check device_ids_write return code
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bae1083472d9c589d59...
Commit: bae1083472d9c589d59f93a4e0a137cb94ba5ed0
Parent: c2be6c38d5d878861b7d4ce601a64bcb88bbe38e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 15 15:04:43 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 15 23:40:56 2021 +0200
cov: check device_ids_write return code
At least 'stack' failure code path as the
function device_id_update_vg_uuid() is void.
---
lib/device/device_id.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index e4208c56b..eb06109ff 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -1351,8 +1351,9 @@ void device_id_update_vg_uuid(struct cmd_context *cmd, struct volume_group *vg,
}
}
- if (update)
- device_ids_write(cmd);
+ if (update &&
+ !device_ids_write(cmd))
+ stack;
out:
unlock_devices_file(cmd);
}
2 years, 6 months
main - cov: ensure id is always initialize
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c2be6c38d5d878861b7...
Commit: c2be6c38d5d878861b7d4ce601a64bcb88bbe38e
Parent: 882141eb8c1a9718652cd903e411b6876aff54ef
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 15 15:00:03 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 15 23:40:56 2021 +0200
cov: ensure id is always initialize
Always resed sd_id128_t id and report warning in case
sd_id128_get_machine_app_specific() does not exit with 0.
---
lib/commands/toolcontext.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index ab574fb55..105aecd5d 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -159,9 +159,11 @@ static const char *_system_id_from_source(struct cmd_context *cmd, const char *s
#ifdef APP_MACHINEID_SUPPORT
if (!strcasecmp(source, "appmachineid")) {
- sd_id128_t id;
+ sd_id128_t id = { 0 };
- sd_id128_get_machine_app_specific(LVM_APPLICATION_ID, &id);
+ if (sd_id128_get_machine_app_specific(LVM_APPLICATION_ID, &id) != 0)
+ log_warn("WARNING: sd_id128_get_machine_app_specific() failed %s (%d).",
+ strerror(errno), errno);
if (dm_snprintf(buf, PATH_MAX, SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(id)) < 0)
stack;
2 years, 6 months
main - cov: check pointer before dereferencing
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=882141eb8c1a9718652...
Commit: 882141eb8c1a9718652cd903e411b6876aff54ef
Parent: 65ba4964df27d2d3f308d2f378e814290ba6d7bb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 15 14:48:48 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 15 23:40:56 2021 +0200
cov: check pointer before dereferencing
Check pv2 is non-null before trying to deref its tags.
---
lib/metadata/lv_manip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 1a4e613a7..003748d6f 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -2354,7 +2354,7 @@ static int _match_pv_tags(const struct dm_config_node *cling_tag_list_cn,
const struct dm_config_value *cv;
const char *str;
const char *tag_matched;
- struct dm_list *tags_to_match = mem ? NULL : pv_tags ? : &pv2->tags;
+ struct dm_list *tags_to_match = mem ? NULL : pv_tags ? : ((pv2) ? &pv2->tags : NULL);
struct dm_str_list *sl;
unsigned first_tag = 1;
@@ -2409,7 +2409,7 @@ static int _match_pv_tags(const struct dm_config_node *cling_tag_list_cn,
continue;
}
- if (!str_list_match_list(&pv1->tags, tags_to_match, &tag_matched))
+ if (tags_to_match && !str_list_match_list(&pv1->tags, tags_to_match, &tag_matched))
continue;
if (!pv_tags) {
2 years, 6 months
main - cov: do not drop already known error state
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=65ba4964df27d2d3f30...
Commit: 65ba4964df27d2d3f308d2f378e814290ba6d7bb
Parent: e7b5f490c53368b9591fe8c5561de4371207f882
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 15 14:46:23 2021 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Oct 15 23:40:56 2021 +0200
cov: do not drop already known error state
Do not try to 'discover' another error state, when ENOMEM
is already detected.
---
daemons/lvmlockd/lvmlockd-core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/daemons/lvmlockd/lvmlockd-core.c b/daemons/lvmlockd/lvmlockd-core.c
index c1785a764..175f59331 100644
--- a/daemons/lvmlockd/lvmlockd-core.c
+++ b/daemons/lvmlockd/lvmlockd-core.c
@@ -3016,9 +3016,7 @@ static int add_lockspace_thread(const char *ls_name,
!alloc_and_copy_pvs_path(&ls2->pvs, &ls->pvs)) {
log_debug("add_lockspace_thread %s fails to allocate pvs", ls->name);
rv = -ENOMEM;
- }
-
- if (ls2->thread_stop) {
+ } else if (ls2->thread_stop) {
log_debug("add_lockspace_thread %s exists and stopping", ls->name);
rv = -EAGAIN;
} else if (!ls2->create_fail && !ls2->create_done) {
2 years, 6 months