master - lvconvert: avoid superfluous interim raid type
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=22a13043683a5647e8c...
Commit: 22a13043683a5647e8cc4e3aead911e5269ffd2f
Parent: 61600f8fa7e150b02c1be5e1f8ee1b008b4efa90
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Aug 31 19:03:52 2018 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Aug 31 19:04:19 2018 +0200
lvconvert: avoid superfluous interim raid type
When converting striped/raid0*/raid6_n_6 <-> raid4,
avoid superfluous interim raid5_n layout.
Related: rhbz1447809
---
lib/metadata/raid_manip.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 6cbf601..2bc179a 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6130,7 +6130,7 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr
seg_flag = SEG_RAID6_N_6;
if (segtype_is_linear(*segtype) ||
- (!segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype)))
+ (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype)))
seg_flag = SEG_RAID5_N;
/* raid1 -> */
@@ -6199,10 +6199,9 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr
lvseg_name(seg_from), display_lvname(seg_from->lv), *new_image_count);
}
- /* raid4 -> !raid4/raid5* */
- } else if (seg_is_raid4(seg_from) &&
- !segtype_is_raid4(*segtype) && !segtype_is_any_raid5(*segtype)) {
- seg_flag = SEG_RAID5_N;
+ /* raid4 -> * */
+ } else if (seg_is_raid4(seg_from) && !segtype_is_raid4(*segtype) && !segtype_is_striped(*segtype)) {
+ seg_flag = segtype_is_any_raid6(*segtype) ? SEG_RAID6_N_6 : SEG_RAID5_N;
/* raid6 -> striped/raid0/raid5/raid10 */
} else if (seg_is_any_raid6(seg_from)) {
5 years
master - test: comment fixes
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=61600f8fa7e150b02c1...
Commit: 61600f8fa7e150b02c1be5e1f8ee1b008b4efa90
Parent: fa0a04236c613fb82e3cd559c6b451f5eb7102ad
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Aug 31 15:07:24 2018 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Aug 31 15:09:55 2018 +0200
test: comment fixes
Fix comments in
test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
test/shell/lvconvert-raid-reshape-stripes-load-reload.sh
test/shell/lvconvert-raid-reshape-stripes-load.sh
---
.../lvconvert-raid-reshape-stripes-load-fail.sh | 2 +-
.../lvconvert-raid-reshape-stripes-load-reload.sh | 2 +-
test/shell/lvconvert-raid-reshape-stripes-load.sh | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh b/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
index c7ccad8..5fa21dc 100644
--- a/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
+++ b/test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
@@ -39,7 +39,7 @@ vgcreate $SHARED -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
-# Create 13-way striped raid5 (14 legs total)
+# Create 10-way striped raid5 (11 legs total)
lvcreate --yes --type raid5_ls --stripesize 64K --stripes 10 -L200M -n$lv1 $vg
check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
check lv_first_seg_field $vg/$lv1 stripesize "64.00k"
diff --git a/test/shell/lvconvert-raid-reshape-stripes-load-reload.sh b/test/shell/lvconvert-raid-reshape-stripes-load-reload.sh
index 839e704..f317b7e 100644
--- a/test/shell/lvconvert-raid-reshape-stripes-load-reload.sh
+++ b/test/shell/lvconvert-raid-reshape-stripes-load-reload.sh
@@ -39,7 +39,7 @@ vgcreate $SHARED -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
-# Create 13-way striped raid5 (14 legs total)
+# Create 10-way striped raid5 (11 legs total)
lvcreate --yes --type raid5_ls --stripesize 64K --stripes 10 -L200M -n$lv1 $vg
check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
check lv_first_seg_field $vg/$lv1 stripesize "64.00k"
diff --git a/test/shell/lvconvert-raid-reshape-stripes-load.sh b/test/shell/lvconvert-raid-reshape-stripes-load.sh
index 29790aa..dd04798 100644
--- a/test/shell/lvconvert-raid-reshape-stripes-load.sh
+++ b/test/shell/lvconvert-raid-reshape-stripes-load.sh
@@ -39,7 +39,7 @@ vgcreate $SHARED -s 1M "$vg" "${DEVICES[@]}"
trap 'cleanup_mounted_and_teardown' EXIT
-# Create 13-way striped raid5 (14 legs total)
+# Create 10-way striped raid5 (11 legs total)
lvcreate --yes --type raid5_ls --stripesize 64K --stripes 10 -L200M -n$lv1 $vg
check lv_first_seg_field $vg/$lv1 segtype "raid5_ls"
check lv_first_seg_field $vg/$lv1 stripesize "64.00k"
5 years, 1 month
master - tests: add scan-lvs
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fa0a04236c613fb82e3...
Commit: fa0a04236c613fb82e3cd559c6b451f5eb7102ad
Parent: bfcecbbce182570d040f3ec446dccb84ca07efcd
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Aug 30 09:54:02 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Aug 30 10:00:36 2018 -0500
tests: add scan-lvs
---
test/shell/scan-lvs.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/test/shell/scan-lvs.sh b/test/shell/scan-lvs.sh
new file mode 100644
index 0000000..8e8a77d
--- /dev/null
+++ b/test/shell/scan-lvs.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+# Copyright (C) 2014 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 scan_lvs config setting
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux extend_filter_LVMTEST
+
+aux lvmconf 'devices/scan_lvs = 1'
+
+aux prepare_pvs 1
+
+vgcreate $SHARED $vg1 "$dev1"
+
+lvcreate -l1 -n $lv1 $vg1
+
+pvcreate "$DM_DEV_DIR/$vg1/$lv1"
+
+pvs "$DM_DEV_DIR/$vg1/$lv1"
+
+aux lvmconf 'devices/scan_lvs = 0'
+
+not pvs "$DM_DEV_DIR/$vg1/$lv1"
+
+pvs --config devices/scan_lvs=1 "$DM_DEV_DIR/$vg1/$lv1"
+
+not pvremove "$DM_DEV_DIR/$vg1/$lv1"
+
+pvremove --config devices/scan_lvs=1 "$DM_DEV_DIR/$vg1/$lv1"
+
+lvchange -an "$vg1/$lv1"
+
+lvremove "$vg1/$lv1"
+
+vgremove $vg1
+
5 years, 1 month
master - filter: add config setting to skip scanning LVs
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bfcecbbce182570d040...
Commit: bfcecbbce182570d040f3ec446dccb84ca07efcd
Parent: a0f6f188416823c2d32bb54bddff00e09f4426e4
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Aug 29 13:14:18 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Aug 30 09:59:50 2018 -0500
filter: add config setting to skip scanning LVs
devices/scan_lvs (default 1) determines whether lvm
will scan LVs for layered PVs. The lvm behavior has
always been to scan LVs, but it's rare for LVs to have
layered PVs, and much more common for there to be many
LVs that substantially slow down scanning with no benefit.
This is implemented in the usable filter, and has the
same effect as listing all LVs in the global_filter.
---
lib/activate/activate.h | 1 +
lib/activate/dev_manager.c | 5 +++++
lib/commands/toolcontext.c | 2 +-
lib/config/config_settings.h | 3 +++
lib/config/defaults.h | 2 ++
lib/filters/filter-usable.c | 27 ++++++++++++++++++++++-----
lib/filters/filter.h | 2 +-
7 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index cca2504..9530c36 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -240,6 +240,7 @@ struct dev_usable_check_params {
unsigned int check_suspended:1;
unsigned int check_error_target:1;
unsigned int check_reserved:1;
+ unsigned int check_lv:1;
};
/*
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 43dba8c..67a49be 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -648,6 +648,11 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check)
}
}
+ if (check.check_lv && uuid && !strncmp(uuid, "LVM-", 4)) {
+ /* Skip LVs */
+ goto out;
+ }
+
if (check.check_reserved && uuid &&
(!strncmp(uuid, CRYPT_TEMP, sizeof(CRYPT_TEMP) - 1) ||
!strncmp(uuid, STRATIS, sizeof(STRATIS) - 1))) {
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 961962c..fa87bcc 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1088,7 +1088,7 @@ static struct dev_filter *_init_lvmetad_filter_chain(struct cmd_context *cmd)
nr_filt++;
/* usable device filter. Required. */
- if (!(filters[nr_filt] = usable_filter_create(cmd->dev_types, FILTER_MODE_NO_LVMETAD))) {
+ if (!(filters[nr_filt] = usable_filter_create(cmd, cmd->dev_types, FILTER_MODE_NO_LVMETAD))) {
log_error("Failed to create usabled device filter");
goto bad;
}
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 1d0cc79..b47b225 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -337,6 +337,9 @@ cfg(devices_sysfs_scan_CFG, "sysfs_scan", devices_CFG_SECTION, 0, CFG_TYPE_BOOL,
"This is a quick way of filtering out block devices that are not\n"
"present on the system. sysfs must be part of the kernel and mounted.)\n")
+cfg(devices_scan_lvs_CFG, "scan_lvs", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_SCAN_LVS, vsn(2, 2, 182), NULL, 0, NULL,
+ "Scan LVM LVs for layered PVs.\n")
+
cfg(devices_multipath_component_detection_CFG, "multipath_component_detection", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_MULTIPATH_COMPONENT_DETECTION, vsn(2, 2, 89), NULL, 0, NULL,
"Ignore devices that are components of DM multipath devices.\n")
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
index 9928fb1..9fbe8c2 100644
--- a/lib/config/defaults.h
+++ b/lib/config/defaults.h
@@ -300,4 +300,6 @@
#define DEFAULT_VDO_POOL_AUTOEXTEND_THRESHOLD 100
#define DEFAULT_VDO_POOL_AUTOEXTEND_PERCENT 20
+#define DEFAULT_SCAN_LVS 1
+
#endif /* _LVM_DEFAULTS_H */
diff --git a/lib/filters/filter-usable.c b/lib/filters/filter-usable.c
index ab5c02f..6997368 100644
--- a/lib/filters/filter-usable.c
+++ b/lib/filters/filter-usable.c
@@ -21,6 +21,11 @@
#include "lib/device/dev-ext-udev-constants.h"
#endif
+struct filter_data {
+ filter_mode_t mode;
+ int skip_lvs;
+};
+
static const char *_too_small_to_hold_pv_msg = "Too small to hold a PV";
static int _native_check_pv_min_size(struct device *dev)
@@ -102,7 +107,9 @@ static int _check_pv_min_size(struct device *dev)
static int _passes_usable_filter(struct cmd_context *cmd, struct dev_filter *f, struct device *dev)
{
- filter_mode_t mode = *((filter_mode_t *) f->private);
+ struct filter_data *data = f->private;
+ filter_mode_t mode = data->mode;
+ int skip_lvs = data->skip_lvs;
struct dev_usable_check_params ucp = {0};
int r = 1;
@@ -115,6 +122,7 @@ static int _passes_usable_filter(struct cmd_context *cmd, struct dev_filter *f,
ucp.check_suspended = ignore_suspended_devices();
ucp.check_error_target = 1;
ucp.check_reserved = 1;
+ ucp.check_lv = skip_lvs;
break;
case FILTER_MODE_PRE_LVMETAD:
ucp.check_empty = 1;
@@ -122,6 +130,7 @@ static int _passes_usable_filter(struct cmd_context *cmd, struct dev_filter *f,
ucp.check_suspended = 0;
ucp.check_error_target = 1;
ucp.check_reserved = 1;
+ ucp.check_lv = skip_lvs;
break;
case FILTER_MODE_POST_LVMETAD:
ucp.check_empty = 0;
@@ -129,6 +138,7 @@ static int _passes_usable_filter(struct cmd_context *cmd, struct dev_filter *f,
ucp.check_suspended = ignore_suspended_devices();
ucp.check_error_target = 0;
ucp.check_reserved = 0;
+ ucp.check_lv = skip_lvs;
break;
}
@@ -162,8 +172,9 @@ static void _usable_filter_destroy(struct dev_filter *f)
free(f);
}
-struct dev_filter *usable_filter_create(struct dev_types *dt __attribute__((unused)), filter_mode_t mode)
+struct dev_filter *usable_filter_create(struct cmd_context *cmd, struct dev_types *dt __attribute__((unused)), filter_mode_t mode)
{
+ struct filter_data *data;
struct dev_filter *f;
if (!(f = zalloc(sizeof(struct dev_filter)))) {
@@ -174,14 +185,20 @@ struct dev_filter *usable_filter_create(struct dev_types *dt __attribute__((unus
f->passes_filter = _passes_usable_filter;
f->destroy = _usable_filter_destroy;
f->use_count = 0;
- if (!(f->private = zalloc(sizeof(filter_mode_t)))) {
+
+ if (!(data = zalloc(sizeof(struct filter_data)))) {
log_error("Usable device filter mode allocation failed");
free(f);
return NULL;
}
- *((filter_mode_t *) f->private) = mode;
- log_debug_devs("Usable device filter initialised.");
+ data->mode = mode;
+
+ data->skip_lvs = !find_config_tree_bool(cmd, devices_scan_lvs_CFG, NULL);
+
+ f->private = data;
+
+ log_debug_devs("Usable device filter initialised (scan_lvs %d).", !data->skip_lvs);
return f;
}
diff --git a/lib/filters/filter.h b/lib/filters/filter.h
index cdd5a14..7333cfe 100644
--- a/lib/filters/filter.h
+++ b/lib/filters/filter.h
@@ -50,6 +50,6 @@ typedef enum {
FILTER_MODE_PRE_LVMETAD,
FILTER_MODE_POST_LVMETAD
} filter_mode_t;
-struct dev_filter *usable_filter_create(struct dev_types *dt, filter_mode_t mode);
+struct dev_filter *usable_filter_create(struct cmd_context *cmd, struct dev_types *dt, filter_mode_t mode);
#endif /* _LVM_FILTER_H */
5 years, 1 month
master - configure: fix LVMCONFIG_PATH assignment
by Peter Rajnoha
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a0f6f188416823c2d32...
Commit: a0f6f188416823c2d32bb54bddff00e09f4426e4
Parent: 03ed2aae3a54afcc521a1af9b8a62827c1fb76d6
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Aug 30 12:59:59 2018 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Aug 30 13:14:10 2018 +0200
configure: fix LVMCONFIG_PATH assignment
---
configure | 2 +-
configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 4ad2d4d..d6ddbc2 100755
--- a/configure
+++ b/configure
@@ -13417,7 +13417,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-LVMCONFIG_PATH="$$BINDIR/lvmconfig"
+LVMCONFIG_PATH="$SBINDIR/lvmconfig"
cat >>confdefs.h <<_ACEOF
#define LVMCONFIG_PATH "$LVMCONFIG_PATH"
diff --git a/configure.ac b/configure.ac
index 8f5349f..6d9308f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1494,7 +1494,7 @@ SBINDIR="$(eval echo $(eval echo $sbindir))"
LVM_PATH="$SBINDIR/lvm"
AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
-LVMCONFIG_PATH="$$BINDIR/lvmconfig"
+LVMCONFIG_PATH="$SBINDIR/lvmconfig"
AC_DEFINE_UNQUOTED(LVMCONFIG_PATH, ["$LVMCONFIG_PATH"], [Path to lvmconfig binary.])
USRSBINDIR="$(eval echo $(eval echo $usrsbindir))"
5 years, 1 month
master - scripts: lvm2-activation-generator: add prefix for all kmsg messages
by Peter Rajnoha
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3d5c4847b663c42573f...
Commit: 3d5c4847b663c42573ffabba7f26f30196f54d82
Parent: cb17ef221bdefea3625a22c19c6d8f5504441771
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Aug 30 12:46:41 2018 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Aug 30 13:14:10 2018 +0200
scripts: lvm2-activation-generator: add prefix for all kmsg messages
Add "lvm2-activation-generator: " prefix for all kmsg messages written by
lvm2-activation-generator so we can identify the message in global system log.
---
WHATS_NEW | 1 +
.../lvm2_activation_generator_systemd_red_hat.c | 24 ++++++++++----------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8489252..6003f0a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Add 'lvm2-activation-generator:' prefix for kmsg messages logged by generator.
Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service.
Reduce max concurrent aios to avoid EMFILE with many devices.
Fix lvconvert conversion attempts to linear.
diff --git a/scripts/lvm2_activation_generator_systemd_red_hat.c b/scripts/lvm2_activation_generator_systemd_red_hat.c
index b751841..5dc39ae 100644
--- a/scripts/lvm2_activation_generator_systemd_red_hat.c
+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c
@@ -57,19 +57,19 @@ static void _error(const char *format, ...)
{
int n;
va_list ap;
- char message[PATH_MAX + 3]; /* +3 for '<n>' where n is the log level */
+ char message[PATH_MAX + 30]; /* +3 for '<n>' where n is the log level and +27 for lvm2-activation-generator: " prefix */
- snprintf(message, 4, "<%d>", LOG_ERR);
+ snprintf(message, 31, "<%d>lvm2-activation-generator: ", LOG_ERR);
va_start(ap, format);
- n = vsnprintf(message + 3, PATH_MAX, format, ap);
+ n = vsnprintf(message + 30, PATH_MAX, format, ap);
va_end(ap);
if (_kmsg_fd < 0 || (n < 0 || ((unsigned) n + 1 > PATH_MAX)))
return;
- /* The n+4: +3 for "<n>" prefix and +1 for '\0' suffix */
- (void) write(_kmsg_fd, message, n + 4);
+ /* The n+31: +30 for "<n>lvm2-activation-generator: " prefix and +1 for '\0' suffix */
+ (void) write(_kmsg_fd, message, n + 31);
}
//----------------------------------------------------------------
@@ -112,7 +112,7 @@ static int register_unit_with_target(struct generator *gen, const char *unit,
(void) dm_prepare_selinux_context(gen->target_path, S_IFDIR);
if (mkdir(gen->target_path, 0755) < 0 && errno != EEXIST) {
- _error("LVM: Failed to create target directory %s: %m.\n", gen->target_path);
+ _error("Failed to create target directory %s: %m.\n", gen->target_path);
r = 0;
goto out;
}
@@ -124,7 +124,7 @@ static int register_unit_with_target(struct generator *gen, const char *unit,
}
(void) dm_prepare_selinux_context(gen->target_path, S_IFLNK);
if (symlink(gen->unit_path, gen->target_path) < 0) {
- _error("LVM: Failed to create symlink for unit %s: %m.\n", unit);
+ _error("Failed to create symlink for unit %s: %m.\n", unit);
r = 0;
}
out:
@@ -144,7 +144,7 @@ static int generate_unit(struct generator *gen, int unit)
return 0;
if (!(f = fopen(gen->unit_path, "wxe"))) {
- _error("LVM: Failed to create unit file %s: %m.\n", unit_name);
+ _error("Failed to create unit file %s: %m.\n", unit_name);
return 0;
}
@@ -181,12 +181,12 @@ static int generate_unit(struct generator *gen, int unit)
fputs("\nType=oneshot\n", f);
if (fclose(f) < 0) {
- _error("LVM: Failed to write unit file %s: %m.\n", unit_name);
+ _error("Failed to write unit file %s: %m.\n", unit_name);
return 0;
}
if (!register_unit_with_target(gen, unit_name, target_name)) {
- _error("LVM: Failed to register unit %s with target %s.\n",
+ _error("Failed to register unit %s with target %s.\n",
unit_name, target_name);
return 0;
}
@@ -197,7 +197,7 @@ static int generate_unit(struct generator *gen, int unit)
static bool _parse_command_line(struct generator *gen, int argc, const char **argv)
{
if (argc != 4) {
- _error("LVM: Incorrect number of arguments for activation generator.\n");
+ _error("Incorrect number of arguments for activation generator.\n");
return false;
}
@@ -239,7 +239,7 @@ int main(int argc, const char **argv)
_log_init();
r = _run(argc, argv);
if (!r)
- _error("LVM: Activation generator failed.\n");
+ _error("Activation generator failed.\n");
_log_exit();
return r ? EXIT_SUCCESS : EXIT_FAILURE;
5 years, 1 month
master - scripts: lvm2-activation-generator: also log possible execv error
by Peter Rajnoha
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=03ed2aae3a54afcc521...
Commit: 03ed2aae3a54afcc521a1af9b8a62827c1fb76d6
Parent: 3d5c4847b663c42573ffabba7f26f30196f54d82
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Aug 30 12:48:50 2018 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Aug 30 13:14:10 2018 +0200
scripts: lvm2-activation-generator: also log possible execv error
---
scripts/generator-internals.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/scripts/generator-internals.c b/scripts/generator-internals.c
index c38323b..00a15e5 100644
--- a/scripts/generator-internals.c
+++ b/scripts/generator-internals.c
@@ -56,7 +56,8 @@ static bool _open_child(struct child_process *child, const char *cmd, const char
close(pipe_fd[1]);
}
- execv(cmd, (char *const *) argv);
+ if (execv(cmd, (char *const *) argv) < 0)
+ _error("execv failed: %s\n", strerror(errno));
// Shouldn't get here unless exec failed.
exit(1);
} else {
5 years, 1 month
master - scripts: add After=rbdmap.service to {lvm2-activation-net, blk-availability}.service
by Peter Rajnoha
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cb17ef221bdefea3625...
Commit: cb17ef221bdefea3625a22c19c6d8f5504441771
Parent: fade9ca3b6ee1432ae8c2878815bbf871cacf92d
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Aug 30 12:35:58 2018 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Aug 30 12:35:58 2018 +0200
scripts: add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service
We need to have Ceph RBD devices mapped first before use in a stack
where LVM is on top so make sure rbdmap.service is called before
generated lvm2-activation-net.service.
On shutdown, we need to stop blk-availability first before we stop the
rbdmap.service.
Resolves: rhbz1623479
---
WHATS_NEW | 1 +
.../blk_availability_systemd_red_hat.service.in | 2 +-
.../lvm2_activation_generator_systemd_red_hat.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index bf03c49..8489252 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service.
Reduce max concurrent aios to avoid EMFILE with many devices.
Fix lvconvert conversion attempts to linear.
Fix lvconvert raid0/raid0_meta -> striped regression.
diff --git a/scripts/blk_availability_systemd_red_hat.service.in b/scripts/blk_availability_systemd_red_hat.service.in
index 1198baa..9462072 100644
--- a/scripts/blk_availability_systemd_red_hat.service.in
+++ b/scripts/blk_availability_systemd_red_hat.service.in
@@ -1,6 +1,6 @@
[Unit]
Description=Availability of block devices
-After=lvm2-activation.service lvm2-lvmetad.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service
+After=lvm2-activation.service lvm2-lvmetad.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service rbdmap.service
DefaultDependencies=no
Conflicts=shutdown.target
diff --git a/scripts/lvm2_activation_generator_systemd_red_hat.c b/scripts/lvm2_activation_generator_systemd_red_hat.c
index b3d18d2..b751841 100644
--- a/scripts/lvm2_activation_generator_systemd_red_hat.c
+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c
@@ -160,7 +160,7 @@ static int generate_unit(struct generator *gen, int unit)
"SourcePath=/etc/lvm/lvm.conf\n" "DefaultDependencies=no\n", f);
if (unit == UNIT_NET) {
- fprintf(f, "After=%s iscsi.service fcoe.service\n"
+ fprintf(f, "After=%s iscsi.service fcoe.service rbdmap.service\n"
"Before=remote-fs-pre.target shutdown.target\n\n"
"[Service]\n"
"ExecStartPre=/usr/bin/udevadm settle\n", _unit_names[UNIT_MAIN]);
5 years, 1 month
master - bcache: reduce MAX_IO to 256
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fade9ca3b6ee1432ae8...
Commit: fade9ca3b6ee1432ae8c2878815bbf871cacf92d
Parent: 3c966e637fe1bec587ceb9ad13aa009db64b4f8e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 24 14:46:51 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 24 14:55:12 2018 -0500
bcache: reduce MAX_IO to 256
This is the number of concurrent async io requests that
the scan layer will submit to the bcache layer. There
will be an open fd for each of these, so it is best to
keep this well below the default limit for max open files
(1024), otherwise lvm may get EMFILE from open(2) when
there are around 1024 devices to scan on the system.
---
WHATS_NEW | 1 +
lib/device/bcache.c | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index fd1b732..bf03c49 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Reduce max concurrent aios to avoid EMFILE with many devices.
Fix lvconvert conversion attempts to linear.
Fix lvconvert raid0/raid0_meta -> striped regression.
Fix lvconvert --splitmirror for mirror type (2.02.178).
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index 8d55c36..e759997 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -198,7 +198,15 @@ static bool _async_issue(struct io_engine *ioe, enum dir d, int fd,
return true;
}
-#define MAX_IO 1024
+/*
+ * MAX_IO is returned to the layer above via bcache_max_prefetches() which
+ * tells the caller how many devices to submit io for concurrently. There will
+ * be an open file descriptor for each of these, so keep it low enough to avoid
+ * reaching the default max open file limit (1024) when there are over 1024
+ * devices being scanned.
+ */
+
+#define MAX_IO 256
#define MAX_EVENT 64
static bool _async_wait(struct io_engine *ioe, io_complete_fn fn)
5 years, 1 month
master - test: add striped -> raid0 test script
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3c966e637fe1bec587c...
Commit: 3c966e637fe1bec587ceb9ad13aa009db64b4f8e
Parent: e83c4f07ca4a84808178d5d22cba655e5e370cd8
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Wed Aug 22 17:11:03 2018 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Wed Aug 22 17:12:44 2018 +0200
test: add striped -> raid0 test script
---
test/shell/lvconvert-striped-raid0.sh | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-striped-raid0.sh b/test/shell/lvconvert-striped-raid0.sh
new file mode 100644
index 0000000..5cfb792
--- /dev/null
+++ b/test/shell/lvconvert-striped-raid0.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2018 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
+
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_raid 1 7 0 || skip
+
+aux prepare_vg 3 16
+
+lvcreate -aey --type striped -i 3 -l3 -n $lv $vg
+lvconvert -y --type raid0_meta $vg/$lv
+check lv_field $vg/$lv segtype "raid0_meta"
+vgremove -ff $vg
5 years, 1 month