master - tests: slightly faster
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fa1290f40e17c82030d...
Commit: fa1290f40e17c82030d23c21af1f318688631759
Parent: 38d460ed6eb386325b708aa3668ffd8899947450
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 1 23:05:11 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 23:40:24 2020 +0200
tests: slightly faster
Use lvm shell to agregrate lots of lvm commands
Reduce initial zeroing.
---
test/shell/pvck-dump.sh | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/shell/pvck-dump.sh b/test/shell/pvck-dump.sh
index 327731295..8892152b2 100644
--- a/test/shell/pvck-dump.sh
+++ b/test/shell/pvck-dump.sh
@@ -16,10 +16,10 @@
aux prepare_devs 4 128
get_devs
-dd if=/dev/zero of="$dev1" bs=1M count=32 || true
-dd if=/dev/zero of="$dev2" bs=1M count=32 || true
-dd if=/dev/zero of="$dev3" bs=1M count=32 || true
-dd if=/dev/zero of="$dev4" bs=1M count=32 || true
+dd if=/dev/zero of="$dev1" bs=1M count=2 || true
+dd if=/dev/zero of="$dev2" bs=1M count=2 || true
+dd if=/dev/zero of="$dev3" bs=1M count=2 || true
+dd if=/dev/zero of="$dev4" bs=1M count=2 || true
# clear entire dev to cover mda2
dd if=/dev/zero of="$dev3" || true
@@ -146,7 +146,7 @@ pvcreate --pvmetadatacopies 2 --metadatasize 32M "$dev1"
vgcreate $SHARED -s 512K --metadatasize 32M $vg "$dev1" "$dev2" "$dev3" "$dev4"
-for i in `seq 1 500`; do lvcreate -an -n lv$i -l1 $vg; done
+for i in $(seq 1 500); do echo "lvcreate -an -n lv$i -l1 $vg"; done | lvm
pvck --dump headers "$dev1" > h1
3 years, 8 months
master - tests: set skipping autoactivation
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=38d460ed6eb386325b7...
Commit: 38d460ed6eb386325b708aa3668ffd8899947450
Parent: ada5728c72e4620c54e4786f31ca5e45cf75d1b0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 1 22:45:17 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 23:40:24 2020 +0200
tests: set skipping autoactivation
On test system with 'default' filter (aka accept all) test
after enabling device can suffer from automatic system
activation - so for created LVs setup skipping this automatic
activation. This should prevent getting LVs into table
with pvscan service.
---
test/shell/duplicate-vgrename.sh | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/test/shell/duplicate-vgrename.sh b/test/shell/duplicate-vgrename.sh
index 86282206f..873195713 100644
--- a/test/shell/duplicate-vgrename.sh
+++ b/test/shell/duplicate-vgrename.sh
@@ -16,7 +16,7 @@ aux prepare_devs 4
# a. 0 local, 1 foreign
# setup
vgcreate $vg1 "$dev1"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID1=$(vgs --noheading -o vg_uuid $vg1 | xargs)
vgchange -y --systemid "other" $vg1
@@ -34,12 +34,12 @@ aux wipefs_a "$dev1"
# b. 0 local, 2 foreign
# setup
vgcreate $vg1 "$dev1"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID1=$(vgs --noheading -o vg_uuid $vg1 | xargs)
vgchange -y --systemid "other" $vg1
aux disable_dev "$dev1"
vgcreate $vg1 "$dev2"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID2=$(vgs --noheading -o vg_uuid $vg1 | xargs)
vgchange -y --systemid "other2" $vg1
aux enable_dev "$dev1"
@@ -67,11 +67,11 @@ aux wipefs_a "$dev2"
# c. 1 local, 1 foreign
# setup
vgcreate $vg1 "$dev1"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID1=$(vgs --noheading -o vg_uuid $vg1 | xargs)
aux disable_dev "$dev1"
vgcreate $vg1 "$dev2"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID2=$(vgs --noheading -o vg_uuid $vg1 | xargs)
vgchange -y --systemid "other" $vg1
aux enable_dev "$dev1"
@@ -99,16 +99,16 @@ aux wipefs_a "$dev2"
# d. 1 local, 2 foreign
# setup
vgcreate $vg1 "$dev1"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID1=$(vgs --noheading -o vg_uuid $vg1 | xargs)
aux disable_dev "$dev1"
vgcreate $vg1 "$dev2"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID2=$(vgs --noheading -o vg_uuid $vg1 | xargs)
vgchange -y --systemid "other" $vg1
aux disable_dev "$dev2"
vgcreate $vg1 "$dev3"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID3=$(vgs --noheading -o vg_uuid $vg1 | xargs)
vgchange -y --systemid "other2" $vg1
aux enable_dev "$dev1"
@@ -140,11 +140,11 @@ aux wipefs_a "$dev3"
# e. 2 local, 0 foreign
# setup
vgcreate $vg1 "$dev1"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID1=$(vgs --noheading -o vg_uuid $vg1 | xargs)
aux disable_dev "$dev1"
vgcreate $vg1 "$dev2"
-lvcreate -n ${lv1}_b -l1 -an $vg1
+lvcreate -n ${lv1}_b -l1 -ky -an $vg1
UUID2=$(vgs --noheading -o vg_uuid $vg1 | xargs)
aux enable_dev "$dev1"
@@ -178,15 +178,15 @@ aux wipefs_a "$dev2"
# f. 2 local, 1 foreign
# setup
vgcreate $vg1 "$dev1"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID1=$(vgs --noheading -o vg_uuid $vg1 | xargs)
aux disable_dev "$dev1"
vgcreate $vg1 "$dev2"
-lvcreate -n ${lv1}_b -l1 -an $vg1
+lvcreate -n ${lv1}_b -l1 -ky -an $vg1
UUID2=$(vgs --noheading -o vg_uuid $vg1 | xargs)
aux disable_dev "$dev2"
vgcreate $vg1 "$dev3"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID3=$(vgs --noheading -o vg_uuid $vg1 | xargs)
vgchange -y --systemid "other" $vg1
aux enable_dev "$dev1"
@@ -246,15 +246,15 @@ aux wipefs_a "$dev3"
# g. 3 local, 0 foreign
# setup
vgcreate $vg1 "$dev1"
-lvcreate -n $lv1 -l1 -an $vg1
+lvcreate -n $lv1 -l1 -ky -an $vg1
UUID1=$(vgs --noheading -o vg_uuid $vg1 | xargs)
aux disable_dev "$dev1"
vgcreate $vg1 "$dev2"
-lvcreate -n ${lv1}_b -l1 -an $vg1
+lvcreate -n ${lv1}_b -l1 -ky -an $vg1
UUID2=$(vgs --noheading -o vg_uuid $vg1 | xargs)
aux disable_dev "$dev2"
vgcreate $vg1 "$dev3"
-lvcreate -n ${lv1}_c -l1 -an $vg1
+lvcreate -n ${lv1}_c -l1 -ky -an $vg1
UUID3=$(vgs --noheading -o vg_uuid $vg1 | xargs)
aux enable_dev "$dev1"
aux enable_dev "$dev2"
3 years, 8 months
master - tests: skip test when gcore cannot catch securetest
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ada5728c72e4620c54e...
Commit: ada5728c72e4620c54e4786f31ca5e45cf75d1b0
Parent: bc13c7d2469d1c3fc1f8d76f9f93c9d594496bf0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 1 21:39:47 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 23:40:24 2020 +0200
tests: skip test when gcore cannot catch securetest
---
test/shell/dmsecuretest.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/shell/dmsecuretest.sh b/test/shell/dmsecuretest.sh
index 144b1f4ae..6fbdb893c 100644
--- a/test/shell/dmsecuretest.sh
+++ b/test/shell/dmsecuretest.sh
@@ -45,7 +45,8 @@ sleep .5
dmsetup status "$DMTEST"
# generate core file for running&sleeping binary
-gcore "$PID" | tee out
+gcore "$PID" | tee out || skip
+
# check we capture core while dmsecuretest was already sleeping
grep "nanosleep" out || grep kernel_vsyscall out
kill "$PID" || true
3 years, 8 months
master - gcc: avoid shadowing of dev_name and pvs
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bc13c7d2469d1c3fc1f...
Commit: bc13c7d2469d1c3fc1f8d76f9f93c9d594496bf0
Parent: 672d5ad98b289663b51b2e34f5fb937c64222abb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 1 21:17:14 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 23:40:24 2020 +0200
gcc: avoid shadowing of dev_name and pvs
Since we declare dev_name in lib/device/device.h
and pvs in commands.h
rename local dev_name to device_name
and pvs to pvs_list to prevent shadowing warning.
m
---
tools/lvconvert.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 04ec1ee4f..0adc61e36 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4267,7 +4267,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
char format[NAME_LEN];
struct dm_list *use_pvh;
struct pv_list *pvl;
- char *dev_name;
+ char *device_name;
struct device *dev_fast;
char *dev_argv[MAX_CACHEDEVS];
int dev_argc = 0;
@@ -4301,10 +4301,10 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
if (!grouped_arg_is_set(group->arg_values, cachedevice_ARG))
continue;
- if (!(dev_name = (char *)grouped_arg_str_value(group->arg_values, cachedevice_ARG, NULL)))
+ if (!(device_name = (char *)grouped_arg_str_value(group->arg_values, cachedevice_ARG, NULL)))
break;
- if (dev_name[0] == '@') {
+ if (device_name[0] == '@') {
if (!cache_size_sectors) {
log_error("With tag as cachedevice, --cachesize is required.");
return 0;
@@ -4312,13 +4312,13 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
goto add_dev_arg;
}
- if (!(dev_fast = dev_cache_get(cmd, dev_name, cmd->filter))) {
- log_error("Device %s not found.", dev_name);
+ if (!(dev_fast = dev_cache_get(cmd, device_name, cmd->filter))) {
+ log_error("Device %s not found.", device_name);
return 0;
}
- if (!(pvl = find_pv_in_vg(vg, dev_name))) {
- log_error("PV %s not found in VG.", dev_name);
+ if (!(pvl = find_pv_in_vg(vg, device_name))) {
+ log_error("PV %s not found in VG.", device_name);
return 0;
}
@@ -4328,7 +4328,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
* entire dev should be used.
*/
if (!cache_size_sectors && pvl->pv->pe_alloc_count) {
- log_error("PV %s is in use, --cachesize is required.", dev_name);
+ log_error("PV %s is in use, --cachesize is required.", device_name);
return 0;
}
@@ -4337,7 +4337,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
if (!arg_is_set(cmd, yes_ARG) &&
yes_no_prompt("Use all %s from %s for cache? [y/n]: ",
- display_size(cmd, pv_size_sectors), dev_name) == 'n') {
+ display_size(cmd, pv_size_sectors), device_name) == 'n') {
log_print("Use --cachesize SizeMB to use a part of the cachedevice.");
log_error("Conversion aborted.");
return 0;
@@ -4350,7 +4350,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
return 0;
}
- dev_argv[dev_argc++] = dev_name;
+ dev_argv[dev_argc++] = device_name;
}
if (!cache_size_sectors)
@@ -4362,7 +4362,7 @@ static int _lv_create_cachevol(struct cmd_context *cmd,
}
if (!(use_pvh = create_pv_list(cmd->mem, vg, dev_argc, dev_argv, 1))) {
- log_error("cachedevice not found in VG %s.", dev_name);
+ log_error("cachedevice not found in VG %s.", device_name);
return 0;
}
@@ -5607,7 +5607,7 @@ static int _set_writecache_block_size(struct cmd_context *cmd,
{
char pathname[PATH_MAX];
struct device *fs_dev;
- struct dm_list pvs;
+ struct dm_list pvs_list;
struct pv_list *pvl;
uint32_t fs_block_size = 0;
uint32_t block_size_setting = 0;
@@ -5620,14 +5620,14 @@ static int _set_writecache_block_size(struct cmd_context *cmd,
if (*block_size_sectors)
block_size_setting = *block_size_sectors * 512;
- dm_list_init(&pvs);
+ dm_list_init(&pvs_list);
- if (!get_pv_list_for_lv(cmd->mem, lv, &pvs)) {
+ if (!get_pv_list_for_lv(cmd->mem, lv, &pvs_list)) {
log_error("Failed to build list of PVs for %s.", display_lvname(lv));
goto_bad;
}
- dm_list_iterate_items(pvl, &pvs) {
+ dm_list_iterate_items(pvl, &pvs_list) {
unsigned int pbs = 0;
unsigned int lbs = 0;
3 years, 8 months
master - gcc: hide warn about possible uninitialized use of dev_ret
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=672d5ad98b289663b51...
Commit: 672d5ad98b289663b51b2e34f5fb937c64222abb
Parent: 11f08dacc920dba49d932ccdf378331a32bad9d9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 1 20:46:18 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 23:40:24 2020 +0200
gcc: hide warn about possible uninitialized use of dev_ret
Older gcc reports this fp problem.
---
lib/metadata/metadata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index bf3669b10..8b8c491c0 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -4679,7 +4679,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
struct volume_group *vg, *vg_ret = NULL;
struct metadata_area *mda, *mda2;
unsigned use_precommitted = precommitted;
- struct device *mda_dev, *dev_ret, *dev;
+ struct device *mda_dev, *dev_ret = NULL, *dev;
struct cached_vg_fmtdata *vg_fmtdata = NULL; /* Additional format-specific data about the vg */
struct pv_list *pvl;
int found_old_metadata = 0;
3 years, 8 months
master - pvck: add simple check for fwrite
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=11f08dacc920dba49d9...
Commit: 11f08dacc920dba49d932ccdf378331a32bad9d9
Parent: 66803586ef6d7ef7bcf4260b66e85ef2fa8c7022
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 1 21:14:39 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 23:40:24 2020 +0200
pvck: add simple check for fwrite
Add at least very light check for result code of fwrite().
---
tools/pvck.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/pvck.c b/tools/pvck.c
index 73ef6ceff..302c74621 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -846,6 +846,7 @@ static int _dump_meta_area(struct device *dev, struct devicefile *def, const cha
{
FILE *fp;
char *meta_buf;
+ int ret = 1;
if (!tofile)
return_0;
@@ -866,7 +867,11 @@ static int _dump_meta_area(struct device *dev, struct devicefile *def, const cha
return 0;
}
- fwrite(meta_buf, mda_size - 512, 1, fp);
+ if (fwrite(meta_buf, mda_size - 512, 1, fp) != 1) {
+ log_error("Failed to write file %s metadata area size %llu.",
+ tofile, (unsigned long long)mda_size);
+ ret = 0;
+ }
free(meta_buf);
@@ -874,7 +879,7 @@ static int _dump_meta_area(struct device *dev, struct devicefile *def, const cha
stack;
if (fclose(fp))
stack;
- return 1;
+ return ret;
}
/* all sizes and offsets in bytes */
3 years, 8 months
master - pvck: use array of bytes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=66803586ef6d7ef7bcf...
Commit: 66803586ef6d7ef7bcf4260b66e85ef2fa8c7022
Parent: 1ff1e86debe29abc0ac706e5e7b89fc5192f191f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 1 21:08:12 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 23:40:24 2020 +0200
pvck: use array of bytes
Fix typo in use array of pointers instead of array of bytes.
This fixes 'break strict-aliasing rules' warning printed with older gcc.
---
tools/pvck.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/pvck.c b/tools/pvck.c
index 3895b7dd9..73ef6ceff 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -2498,7 +2498,7 @@ fail:
static int _update_mda(struct cmd_context *cmd, struct metadata_file *mf, struct device *dev,
int mda_num, uint64_t mda_offset, uint64_t mda_size)
{
- char *buf[512];
+ char buf[512];
struct mda_header *mh;
struct raw_locn *rlocn0, *rlocn1;
uint64_t max_size;
@@ -2514,7 +2514,7 @@ static int _update_mda(struct cmd_context *cmd, struct metadata_file *mf, struct
goto fail;
}
- if (!dev_read_bytes(dev, mda_offset, 512, buf)) {
+ if (!dev_read_bytes(dev, mda_offset, sizeof(buf), buf)) {
log_print("CHECK: failed to read mda_header_%d at %llu",
mda_num, (unsigned long long)mda_offset);
goto fail;
3 years, 8 months
master - cleanup: better expressing passing key arg to _hash
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1ff1e86debe29abc0ac...
Commit: 1ff1e86debe29abc0ac706e5e7b89fc5192f191f
Parent: 4baedfc5787e5b87cfb3f4b0ea13a6ae9bc9c52e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Aug 29 22:37:17 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 17:57:50 2020 +0200
cleanup: better expressing passing key arg to _hash
---
base/data-struct/hash.c | 9 +++++----
libdm/datastruct/hash.c | 9 +++++----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/base/data-struct/hash.c b/base/data-struct/hash.c
index 5ef5ed276..d60f28a25 100644
--- a/base/data-struct/hash.c
+++ b/base/data-struct/hash.c
@@ -59,26 +59,27 @@ static unsigned char _nums[] = {
209
};
-static struct dm_hash_node *_create_node(const char *str, unsigned len)
+static struct dm_hash_node *_create_node(const void *key, unsigned len)
{
struct dm_hash_node *n = malloc(sizeof(*n) + len);
if (n) {
- memcpy(n->key, str, len);
+ memcpy(n->key, key, len);
n->keylen = len;
}
return n;
}
-static unsigned long _hash(const char *str, unsigned len)
+static unsigned long _hash(const void *key, unsigned len)
{
+ const unsigned char *str = key;
unsigned long h = 0, g;
unsigned i;
for (i = 0; i < len; i++) {
h <<= 4;
- h += _nums[(unsigned char) *str++];
+ h += _nums[*str++];
g = h & ((unsigned long) 0xf << 16u);
if (g) {
h ^= g >> 16u;
diff --git a/libdm/datastruct/hash.c b/libdm/datastruct/hash.c
index 726347ea2..67261f8da 100644
--- a/libdm/datastruct/hash.c
+++ b/libdm/datastruct/hash.c
@@ -57,26 +57,27 @@ static unsigned char _nums[] = {
209
};
-static struct dm_hash_node *_create_node(const char *str, unsigned len)
+static struct dm_hash_node *_create_node(const void *key, unsigned len)
{
struct dm_hash_node *n = dm_malloc(sizeof(*n) + len);
if (n) {
- memcpy(n->key, str, len);
+ memcpy(n->key, key, len);
n->keylen = len;
}
return n;
}
-static unsigned long _hash(const char *str, unsigned len)
+static unsigned long _hash(const void *key, unsigned len)
{
+ const unsigned char *str = key;
unsigned long h = 0, g;
unsigned i;
for (i = 0; i < len; i++) {
h <<= 4;
- h += _nums[(unsigned char) *str++];
+ h += _nums[*str++];
g = h & ((unsigned long) 0xf << 16u);
if (g) {
h ^= g >> 16u;
3 years, 8 months
master - cleanup: add spaces between literals
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4baedfc5787e5b87cfb...
Commit: 4baedfc5787e5b87cfb3f4b0ea13a6ae9bc9c52e
Parent: a37565709232085a61063385c1042a0ade0bc10b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Aug 29 21:53:31 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 17:57:50 2020 +0200
cleanup: add spaces between literals
---
tools/vgextend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/vgextend.c b/tools/vgextend.c
index dca87ff62..52393340f 100644
--- a/tools/vgextend.c
+++ b/tools/vgextend.c
@@ -111,7 +111,7 @@ static int _vgextend_single(struct cmd_context *cmd, const char *vg_name,
if ((mda_copies != VGMETADATACOPIES_UNMANAGED) &&
(mda_copies != mda_used)) {
- log_warn("WARNING: Changing preferred number of copies of VG %s metadata from %"PRIu32" to %"PRIu32,
+ log_warn("WARNING: Changing preferred number of copies of VG %s metadata from %" PRIu32 " to %" PRIu32,
vg_name, mda_copies, mda_used);
vg_set_mda_copies(vg, mda_used);
}
3 years, 8 months
master - cleanup: user force_t enums instead of ints
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a37565709232085a610...
Commit: a37565709232085a61063385c1042a0ade0bc10b
Parent: dbb19f6ace5210a880f107cbae34081db0457d1e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Aug 29 21:53:05 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 1 17:57:50 2020 +0200
cleanup: user force_t enums instead of ints
---
tools/lvcreate.c | 4 ++--
tools/vgextend.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 3357a08c5..e384291ae 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1826,7 +1826,7 @@ static int _lvcreate_and_attach_writecache_single(struct cmd_context *cmd,
log_error("Removing new LV after failing to add writecache.");
if (!deactivate_lv(cmd, lv))
log_error("Failed to deactivate new LV %s.", display_lvname(lv));
- if (!lv_remove_with_dependencies(cmd, lv, 1, 0))
+ if (!lv_remove_with_dependencies(cmd, lv, DONT_PROMPT, 0))
log_error("Failed to remove new LV %s.", display_lvname(lv));
return ECMD_FAILED;
}
@@ -1900,7 +1900,7 @@ static int _lvcreate_and_attach_cache_single(struct cmd_context *cmd,
log_error("Removing new LV after failing to add cache.");
if (!deactivate_lv(cmd, lv))
log_error("Failed to deactivate new LV %s.", display_lvname(lv));
- if (!lv_remove_with_dependencies(cmd, lv, 1, 0))
+ if (!lv_remove_with_dependencies(cmd, lv, DONT_PROMPT, 0))
log_error("Failed to remove new LV %s.", display_lvname(lv));
return ECMD_FAILED;
}
diff --git a/tools/vgextend.c b/tools/vgextend.c
index da768981d..dca87ff62 100644
--- a/tools/vgextend.c
+++ b/tools/vgextend.c
@@ -161,7 +161,7 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
pp->preserve_existing = 1;
/* pvcreate within vgextend cannot be forced. */
- pp->force = 0;
+ pp->force = PROMPT;
if (!lock_global(cmd, "ex"))
return_ECMD_FAILED;
3 years, 8 months