main - cleanup: easier print of historical lv
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c05077f4d4534fd0f63...
Commit: c05077f4d4534fd0f63a9642b596262843f81e30
Parent: 177b63becc8ac0c0a9d74132f419f9ec38d4323d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 9 12:30:25 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 10 01:11:52 2021 +0100
cleanup: easier print of historical lv
Drop unneeded macros.
---
lib/format_text/export.c | 41 +++++++++++++++++++++++------------------
lib/format_text/text_export.h | 2 --
2 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/lib/format_text/export.c b/lib/format_text/export.c
index 2253a80af..6ece94042 100644
--- a/lib/format_text/export.c
+++ b/lib/format_text/export.c
@@ -880,45 +880,50 @@ bad:
return 0;
}
-static int _print_historical_lv(struct formatter *f, struct historical_logical_volume *hlv)
+static int _print_historical_lv_with_descendants(struct formatter *f, struct historical_logical_volume *hlv,
+ char *descendants_buffer)
{
char buffer[40];
- char *descendants_buffer = NULL;
- int r = 0;
if (!id_write_format(&hlv->lvid.id[1], buffer, sizeof(buffer)))
- goto_out;
-
- if (!_alloc_printed_indirect_descendants(&hlv->indirect_glvs, &descendants_buffer))
- goto_out;
+ return_0;
- outnlgo(f);
- outfgo(f, "%s {", hlv->name);
+ outnl(f);
+ outf(f, "%s {", hlv->name);
_inc_indent(f);
- outfgo(f, "id = \"%s\"", buffer);
+ outf(f, "id = \"%s\"", buffer);
if (!_print_timestamp(f, "creation_time", hlv->timestamp, buffer, sizeof(buffer)))
- goto_out;
+ return_0;
if (!_print_timestamp(f, "removal_time", hlv->timestamp_removed, buffer, sizeof(buffer)))
- goto_out;
+ return_0;
if (hlv->indirect_origin) {
if (hlv->indirect_origin->is_historical)
- outfgo(f, "origin = \"%s%s\"", HISTORICAL_LV_PREFIX, hlv->indirect_origin->historical->name);
+ outf(f, "origin = \"%s%s\"", HISTORICAL_LV_PREFIX, hlv->indirect_origin->historical->name);
else
- outfgo(f, "origin = \"%s\"", hlv->indirect_origin->live->name);
+ outf(f, "origin = \"%s\"", hlv->indirect_origin->live->name);
}
if (descendants_buffer)
- outfgo(f, "descendants = %s", descendants_buffer);
+ outf(f, "descendants = %s", descendants_buffer);
_dec_indent(f);
- outfgo(f, "}");
+ outf(f, "}");
+
+ return 1;
+}
+
+static int _print_historical_lv(struct formatter *f, struct historical_logical_volume *hlv)
+{
+ char *descendants_buffer = NULL;
+ int r = 0;
+
+ if (_alloc_printed_indirect_descendants(&hlv->indirect_glvs, &descendants_buffer))
+ r = _print_historical_lv_with_descendants(f, hlv, descendants_buffer);
- r = 1;
-out:
free(descendants_buffer);
return r;
diff --git a/lib/format_text/text_export.h b/lib/format_text/text_export.h
index c20c234d5..33c136bb3 100644
--- a/lib/format_text/text_export.h
+++ b/lib/format_text/text_export.h
@@ -20,9 +20,7 @@
#define outhint(args...) do {if (!out_hint(args)) return_0;} while (0)
#define outfc(args...) do {if (!out_text_with_comment(args)) return_0;} while (0)
#define outf(args...) do {if (!out_text(args)) return_0;} while (0)
-#define outfgo(args...) do {if (!out_text(args)) goto_out;} while (0)
#define outnl(f) do {if (!out_newline(f)) return_0;} while (0)
-#define outnlgo(f) do {if (!out_newline(f)) goto_out;} while (0)
struct formatter;
struct lv_segment;
3 years, 2 months
main - backup: set in vg_commit
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=177b63becc8ac0c0a9d...
Commit: 177b63becc8ac0c0a9d74132f419f9ec38d4323d
Parent: 88d04e917363a65374582313b3a4686ec51ea25c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 9 11:30:28 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 10 01:09:46 2021 +0100
backup: set in vg_commit
Another step towards better automatic handling of backup,
and automatically setup needs_backup after commit.
In some next step we should reduce number of backups and takem
then only at the command finish with vg_committed content.
---
lib/metadata/lv_manip.c | 2 --
lib/metadata/metadata.c | 3 ++-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index f580e5835..2ecd45eb1 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6791,8 +6791,6 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
display_lvname(pool_lv));
}
- vg->needs_backup = 1;
-
lockd_lv(cmd, lock_lv, "un", LDLV_PERSISTENT);
lockd_free_lv(cmd, vg, lv->name, &lv->lvid.id[1], lv->lock_args);
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 5de144616..22cb78337 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3173,7 +3173,8 @@ int vg_commit(struct volume_group *vg)
dm_list_init(&vg->msg_list);
vg->needs_write_and_commit = 0;
}
- }
+ vg->needs_backup = 0;
+ }
/* If at least one mda commit succeeded, it was committed */
return ret;
3 years, 2 months
main - lvm-file: remove duplication of dm_is_empty_dir
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=88d04e917363a653745...
Commit: 88d04e917363a65374582313b3a4686ec51ea25c
Parent: 413a114cdbb1fa0c198fb9a3f71d47dcb3d5e28d
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 9 11:10:47 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 10 01:09:14 2021 +0100
lvm-file: remove duplication of dm_is_empty_dir
---
device_mapper/libdm-file.c | 2 +-
lib/activate/fs.c | 2 +-
lib/misc/lvm-file.c | 20 --------------------
lib/misc/lvm-file.h | 5 -----
4 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/device_mapper/libdm-file.c b/device_mapper/libdm-file.c
index 37c6ce793..94ca146f1 100644
--- a/device_mapper/libdm-file.c
+++ b/device_mapper/libdm-file.c
@@ -110,7 +110,7 @@ int dm_is_empty_dir(const char *dir)
DIR *d;
if (!(d = opendir(dir))) {
- log_sys_error("opendir", dir);
+ log_sys_debug("opendir", dir);
return 0;
}
diff --git a/lib/activate/fs.c b/lib/activate/fs.c
index 96f7df678..2e8098ddf 100644
--- a/lib/activate/fs.c
+++ b/lib/activate/fs.c
@@ -76,7 +76,7 @@ static int _rm_dir(const char *dev_dir, const char *vg_name)
return 0;
}
- if (dir_exists(vg_path) && is_empty_dir(vg_path)) {
+ if (dir_exists(vg_path) && dm_is_empty_dir(vg_path)) {
log_very_verbose("Removing directory %s", vg_path);
rmdir(vg_path);
}
diff --git a/lib/misc/lvm-file.c b/lib/misc/lvm-file.c
index 883b22de6..4a3479a5a 100644
--- a/lib/misc/lvm-file.c
+++ b/lib/misc/lvm-file.c
@@ -141,26 +141,6 @@ int dir_exists(const char *path)
return 1;
}
-int is_empty_dir(const char *dir)
-{
- struct dirent *dirent;
- DIR *d;
-
- if (!(d = opendir(dir))) {
- log_sys_error("opendir", dir);
- return 0;
- }
-
- while ((dirent = readdir(d)))
- if (strcmp(dirent->d_name, ".") && strcmp(dirent->d_name, ".."))
- break;
-
- if (closedir(d))
- log_sys_error("closedir", dir);
-
- return dirent ? 0 : 1;
-}
-
void sync_dir(const char *file)
{
int fd;
diff --git a/lib/misc/lvm-file.h b/lib/misc/lvm-file.h
index 6128abd14..4c405e683 100644
--- a/lib/misc/lvm-file.h
+++ b/lib/misc/lvm-file.h
@@ -41,11 +41,6 @@ int lvm_rename(const char *old, const char *new);
int path_exists(const char *path);
int dir_exists(const char *path);
-/*
- * Return 1 if dir is empty
- */
-int is_empty_dir(const char *dir);
-
/* Sync directory changes */
void sync_dir(const char *file);
3 years, 2 months
main - thin: correct ptr test for thin snapshot merging
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=413a114cdbb1fa0c198...
Commit: 413a114cdbb1fa0c198fb9a3f71d47dcb3d5e28d
Parent: b2616cd45670866b4f5b46675fe3f1563eea3415
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 9 16:23:08 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 10 01:09:14 2021 +0100
thin: correct ptr test for thin snapshot merging
The correct test needs to actually check 'lv->snapshot' is not NULL,
so the 'find_snapshot()' can work.
Test lv_is_snapshot was actually irrelavant for this case.
Also initialize device_id.
---
tools/lvconvert_poll.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lvconvert_poll.c b/tools/lvconvert_poll.c
index 0eae74616..5adb14506 100644
--- a/tools/lvconvert_poll.c
+++ b/tools/lvconvert_poll.c
@@ -174,9 +174,9 @@ progress_t poll_thin_merge_progress(struct cmd_context *cmd,
const char *name __attribute__((unused)),
struct daemon_parms *parms)
{
- uint32_t device_id;
+ uint32_t device_id = 0;
- if (!lv_thin_device_id(lv, &device_id) && !lv_is_snapshot(lv)) {
+ if (!lv_thin_device_id(lv, &device_id) || !lv->snapshot) {
stack;
return PROGRESS_CHECK_FAILED;
}
3 years, 2 months
main - device_mapper: keep bigger size for most ioctls
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b2616cd45670866b4f5...
Commit: b2616cd45670866b4f5b46675fe3f1563eea3415
Parent: d2a3bfe6ca75f151a9fa37276dc0f8e3e6dc4ba4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 9 14:58:09 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 10 01:07:16 2021 +0100
device_mapper: keep bigger size for most ioctls
Actually the idea was to keep 2K ioctl only for certain command,
so keep 16 for them.
---
device_mapper/ioctl/libdm-iface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/device_mapper/ioctl/libdm-iface.c b/device_mapper/ioctl/libdm-iface.c
index 906d84b4e..6b3818e3a 100644
--- a/device_mapper/ioctl/libdm-iface.c
+++ b/device_mapper/ioctl/libdm-iface.c
@@ -1140,12 +1140,12 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
switch (dmt->type) {
case DM_DEVICE_CREATE:
case DM_DEVICE_DEPS:
- case DM_DEVICE_INFO:
case DM_DEVICE_LIST:
case DM_DEVICE_STATUS:
case DM_DEVICE_TABLE:
case DM_DEVICE_TARGET_MSG:
min_size = 16 * 1024;
+ break;
default:
min_size = 2 * 1024;
}
3 years, 2 months
main - vg_write: shift check for exported metadata
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d2a3bfe6ca75f151a9f...
Commit: d2a3bfe6ca75f151a9fa37276dc0f8e3e6dc4ba4
Parent: 17802084c90df4ced26ae395292f0fc8466e72b7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 9 17:45:42 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 10 01:00:18 2021 +0100
vg_write: shift check for exported metadata
Since we now immediatelly use created buffer for CFT creation,
the result needs to be validate before such use.
---
lib/format_text/format-text.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 3ed6aa54a..64ad4677c 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -661,6 +661,11 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
(void) dm_snprintf(desc, sizeof(desc), "Write[%u] from %s.", vg->write_count, vg->cmd->cmd_line);
new_size = text_vg_export_raw(vg, desc, &write_buf, &write_buf_size);
+ if (!new_size || !write_buf) {
+ log_error("VG %s metadata writing failed", vg->name);
+ goto out;
+ }
+
fidtc->write_buf = write_buf;
fidtc->write_buf_size = write_buf_size;
fidtc->new_metadata_size = new_size;
@@ -681,11 +686,6 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
goto_out;
}
- if (!new_size || !write_buf) {
- log_error("VG %s metadata writing failed", vg->name);
- goto out;
- }
-
log_debug_metadata("VG %s seqno %u metadata write to %s mda_start %llu mda_size %llu mda_last %llu",
vg->name, vg->seqno, devname,
(unsigned long long)mda_start,
3 years, 2 months
main - bcache: fix incorrect pointer check
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=17802084c90df4ced26...
Commit: 17802084c90df4ced26ae395292f0fc8466e72b7
Parent: d5f3239de4aa33f51cc8db7fc2e29db41cab9152
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Mar 9 19:35:53 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 10 00:59:05 2021 +0100
bcache: fix incorrect pointer check
With commit b44db5d1a7ecc2e8e3cef0852c4397b64ddf0a09
needs to check allocated pointer for failed malloc().
Existing check was actually no checking anything so failing
malloc here would result in segfault (although with very
low chance to ever happen).
---
lib/device/bcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index a3803befb..a5f2a5a86 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -74,7 +74,7 @@ static struct cb_set *_cb_set_create(unsigned nr)
unsigned i;
struct cb_set *cbs = malloc(sizeof(*cbs) + nr * sizeof(*cbs->vec));
- if (!cbs->vec)
+ if (!cbs)
return NULL;
dm_list_init(&cbs->free);
3 years, 2 months
main - tests: check_devicesfile
by David Teigland
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d5f3239de4aa33f51cc...
Commit: d5f3239de4aa33f51cc8db7fc2e29db41cab9152
Parent: 843ee943ab4ff9d05817c6b59bd778cc4182ccc2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Mar 8 17:19:26 2021 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Mar 8 17:19:26 2021 -0600
tests: check_devicesfile
make check_devicesfile T=...
(A number of tests should probably get a new
SKIP_WITH_DEVICES_FILE.)
---
test/Makefile.in | 7 +++++++
test/lib/aux.sh | 23 ++++++++++++++++-------
test/lib/flavour-ndev-devicesfile.sh | 2 ++
test/lib/inittest.sh | 2 ++
4 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 882620362..41ddb9d8e 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -81,6 +81,7 @@ help:
@echo " check_system Run all tests using udev."
@echo " check_local Run tests."
@echo " check_lvmpolld Run tests with lvmpolld daemon."
+ @echo " check_devicesfile Run tests using a devices file."
@echo " check_all_lvmpolld Run all tests with lvmpolld daemon."
@echo " check_lvmlockd_sanlock Run tests with lvmlockd and sanlock."
@echo " check_lvmlockd_dlm Run tests with lvmlockd and dlm."
@@ -148,6 +149,11 @@ check_all_lvmpolld: .tests-stamp
--flavours ndev-lvmpolld --only $(T) --skip $(S)
endif
+check_devicesfile: .tests-stamp
+ VERBOSE=$(VERBOSE) ./lib/runner \
+ --testdir . --outdir $(LVM_TEST_RESULTS) \
+ --flavours ndev-devicesfile --only $(T) --skip $(S)
+
ifeq ("@BUILD_LVMLOCKD@", "yes")
check_lvmlockd_sanlock: .tests-stamp
VERBOSE=$(VERBOSE) ./lib/runner \
@@ -179,6 +185,7 @@ EXECDIR = $(libexecdir)/lvm2-testsuite
LIB_FLAVOURS = \
flavour-ndev-lvmpolld\
flavour-ndev-vanilla\
+ flavour-ndev-devicesfile\
flavour-udev-lvmpolld\
flavour-udev-lvmlockd-sanlock\
flavour-udev-lvmlockd-dlm\
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 1500e1f6a..0e10a06dd 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -822,7 +822,9 @@ wipefs_a() {
local dev=$1
shift
-# lvmdevices --deldev $dev || true
+ if test -n "$LVM_TEST_DEVICES_FILE"; then
+ lvmdevices --deldev $dev || true
+ fi
if wipefs -V >/dev/null; then
wipefs -a "$dev"
@@ -831,7 +833,10 @@ wipefs_a() {
mdadm --zero-superblock "$dev" || true
fi
-# lvmdevices --adddev $dev || true
+ if test -n "$LVM_TEST_DEVICES_FILE"; then
+ lvmdevices --adddev $dev || true
+ fi
+
}
prepare_backing_dev() {
@@ -917,11 +922,13 @@ prepare_devs() {
wipefs -a "$d" 2>/dev/null || true
done
-# mkdir -p $TESTDIR/etc/lvm/devices || true
-# rm $TESTDIR/etc/lvm/devices/system.devices || true
-# for d in "${DEVICES[@]}"; do
-# lvmdevices --adddev $dev || true
-# done
+ if test -n "$LVM_TEST_DEVICES_FILE"; then
+ mkdir -p $TESTDIR/etc/lvm/devices || true
+ rm $TESTDIR/etc/lvm/devices/system.devices || true
+ for d in "${DEVICES[@]}"; do
+ lvmdevices --adddev $dev || true
+ done
+ fi
#for i in `seq 1 $n`; do
# local name="${PREFIX}$pvname$i"
@@ -1276,6 +1283,7 @@ generate_config() {
LVM_TEST_LOCKING=${LVM_TEST_LOCKING:-1}
LVM_TEST_LVMPOLLD=${LVM_TEST_LVMPOLLD:-0}
LVM_TEST_LVMLOCKD=${LVM_TEST_LVMLOCKD:-0}
+ LVM_TEST_DEVICES_FILE=${LVM_TEST_DEVICES_FILE:-0}
# FIXME:dct: This is harmful! Variables are unused here and are tested not being empty elsewhere:
#LVM_TEST_LOCK_TYPE_SANLOCK=${LVM_TEST_LOCK_TYPE_SANLOCK:-0}
#LVM_TEST_LOCK_TYPE_DLM=${LVM_TEST_LOCK_TYPE_DLM:-0}
@@ -1310,6 +1318,7 @@ devices/md_component_detection = 0
devices/scan = "$DM_DEV_DIR"
devices/sysfs_scan = 1
devices/write_cache_state = 0
+devices/use_devicesfile = $LVM_TEST_DEVICES_FILE
global/abort_on_internal_errors = 1
global/cache_check_executable = "$LVM_TEST_CACHE_CHECK_CMD"
global/cache_dump_executable = "$LVM_TEST_CACHE_DUMP_CMD"
diff --git a/test/lib/flavour-ndev-devicesfile.sh b/test/lib/flavour-ndev-devicesfile.sh
new file mode 100644
index 000000000..21168fdcc
--- /dev/null
+++ b/test/lib/flavour-ndev-devicesfile.sh
@@ -0,0 +1,2 @@
+export LVM_TEST_LOCKING=1
+export LVM_TEST_DEVICES_FILE=1
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index 44000b951..ee049fb79 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -37,6 +37,7 @@ SHARED=${SHARED-}
LVM_TEST_LVMLOCKD=${LVM_TEST_LVMLOCKD-}
LVM_TEST_LVMLOCKD_TEST=${LVM_TEST_LVMLOCKD_TEST-}
LVM_TEST_LVMPOLLD=${LVM_TEST_LVMPOLLD-}
+LVM_TEST_DEVICES_FILE=${LVM_TEST_DEVICES_FILE-}
LVM_TEST_LOCK_TYPE_DLM=${LVM_TEST_LOCK_TYPE_DLM-}
LVM_TEST_LOCK_TYPE_SANLOCK=${LVM_TEST_LOCK_TYPE_SANLOCK-}
@@ -64,6 +65,7 @@ unset CDPATH
export LVM_TEST_BACKING_DEVICE LVM_TEST_DEVDIR LVM_TEST_NODEBUG
export LVM_TEST_LVMLOCKD LVM_TEST_LVMLOCKD_TEST
export LVM_TEST_LVMPOLLD LVM_TEST_LOCK_TYPE_DLM LVM_TEST_LOCK_TYPE_SANLOCK
+export LVM_TEST_DEVICES_FILE
# grab some common utilities
. lib/utils
3 years, 2 months
main - lvremove: correct return code
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=843ee943ab4ff9d0581...
Commit: 843ee943ab4ff9d05817c6b59bd778cc4182ccc2
Parent: 3cbb751815ed545df905d49716444314beb5996c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 8 20:24:04 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 8 20:24:04 2021 +0100
lvremove: correct return code
Need to return ECMD_FAILED from toollib code.
Add missing stack traces.
---
lib/metadata/lv_manip.c | 4 ++--
tools/toollib.c | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 5573e6f43..f580e5835 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6610,7 +6610,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
!lv_is_pending_delete(lv) &&
lv_is_visible(lv)) {
if (vg->needs_write_and_commit && (!vg_write(vg) || !vg_commit(vg)))
- return 0;
+ return_0;
if (yes_no_prompt("Do you really want to remove%s active "
"%slogical volume %s? [y/n]: ",
ask_discard ? " and DISCARD" : "",
@@ -6651,7 +6651,7 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
if (!lv_is_historical(lv) && (force == PROMPT) && ask_discard) {
/* try to store on disks already confirmed removals */
if (vg->needs_write_and_commit && (!vg_write(vg) || !vg_commit(vg)))
- return 0;
+ return_0;
if (yes_no_prompt("Do you really want to remove and DISCARD "
"logical volume %s? [y/n]: ",
display_lvname(lv)) == 'n') {
diff --git a/tools/toollib.c b/tools/toollib.c
index 41e722c5c..28bfb8398 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -3218,9 +3218,8 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
if (vg->needs_write_and_commit && (ret_max == ECMD_PROCESSED) &&
(!vg_write(vg) || !vg_commit(vg)))
- return_0;
-
- if (vg->needs_backup)
+ ret_max = ECMD_FAILED;
+ else if (vg->needs_backup)
backup(vg);
if (lvargs_supplied) {
3 years, 2 months
main - WHATS_NEW: updates
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3cbb751815ed545df90...
Commit: 3cbb751815ed545df905d49716444314beb5996c
Parent: 6d6e1ae8873cc4b91425e8f2edeba88cf79d8321
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Mar 8 15:41:19 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Mar 8 15:43:27 2021 +0100
WHATS_NEW: updates
---
WHATS_NEW | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index cbd542fed..568a7df90 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,9 @@
Version 2.03.12 -
===================================
+ Improve hash function with less collisions and make it faster.
+ Reduce ioctl count when deactivating volumes.
+ Reduce number of metadata parsing.
+ Enhance performance of lvremove and vgremove commands.
Support interruption when taking archive and backup.
Accelerate large lvremoves.
Speedup search for cached device nodes.
3 years, 2 months