Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1b1c01a27b359f8e…
Commit: 1b1c01a27b359f8e91c3c9e08684c435d8fd51c2
Parent: 72d700b064fb64f6bb7e20c23dbb2ce8b6d8feb7
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Oct 13 09:44:33 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 14:40:44 2015 +0200
log: no file for external logging
When external logging is set do not bother creating log file,
as it's not going to be used.
---
WHATS_NEW | 1 +
lib/log/log.c | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index c089228..7507b9c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Avoid creation of log file when logging function is set.
Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
diff --git a/lib/log/log.c b/lib/log/log.c
index bd11363..7f31361 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -74,6 +74,10 @@ void init_log_file(const char *log_file, int append)
int i = 0;
_log_file_path[0] = '\0';
+
+ if (_lvm2_log_fn)
+ return; /* No log file, when log function is set */
+
if ((env = getenv("LVM_LOG_FILE_EPOCH"))) {
while (isalpha(env[i]) && i < 32) /* Up to 32 alphas */
i++;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=72d700b064fb64f6…
Commit: 72d700b064fb64f6bb7e20c23dbb2ce8b6d8feb7
Parent: 86b04ebd193c9db09ee5f03a2de4997aa2ab52c3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 9 21:38:50 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 14:39:37 2015 +0200
toolcontext: do not change already set dm_log
If the dm_log is already set to non-default logger,
avoid to change it.
---
WHATS_NEW | 1 +
lib/commands/toolcontext.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 348c099..c089228 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Do not change logging in lvm2 library when it's already set.
Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
Fix vgimportclone with -n to not add number unnecessarily to base VG name.
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index c8d96ca..c150991 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -362,7 +362,8 @@ static void _init_logging(struct cmd_context *cmd)
/* Tell device-mapper about our logging */
#ifdef DEVMAPPER_SUPPORT
- dm_log_with_errno_init(print_log);
+ if (!dm_log_is_non_default())
+ dm_log_with_errno_init(print_log);
#endif
reset_log_duplicated();
reset_lvm_errno(1);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c7b4359ff4163409…
Commit: c7b4359ff41634096770d464d362d43d2e82bbda
Parent: 5695c6aca63b2312e76f8b3fbbea95601269f8c8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 7 15:10:03 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Oct 13 14:37:07 2015 +0200
thin: check for overflown pool earlier
Check for pool early before we actually start to modify metadata.
This requires locally active thin-pool.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 18 ++++++++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f683456..348c099 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
Fix vgimportclone with -n to not add number unnecessarily to base VG name.
Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 3e870d5..8a0bbcd 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -7087,12 +7087,18 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
}
}
- if (seg_is_thin_volume(lp) &&
- lv_is_new_thin_pool(pool_lv)) {
- thin_pool_was_active = lv_is_active(pool_lv);
- if (!check_new_thin_pool(pool_lv))
- return_NULL;
- /* New pool is now inactive */
+ if (seg_is_thin_volume(lp)) {
+ if (lv_is_new_thin_pool(pool_lv)) {
+ thin_pool_was_active = lv_is_active(pool_lv);
+ if (!check_new_thin_pool(pool_lv))
+ return_NULL;
+ /* New pool is now inactive */
+ } else if (!pool_below_threshold(first_seg(pool_lv))) {
+ log_error("Cannot create new thin volume, free space in "
+ "thin pool %s reached threshold.",
+ display_lvname(pool_lv));
+ return NULL;
+ }
}
if (seg_is_cache(lp) &&
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5ac81657e5d312b7…
Commit: 5ac81657e5d312b72d746bc7cf22a4e6bb5b1609
Parent: 5bd63df237bc3426d1ebd41b103430063846b3ab
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Tue Oct 13 12:18:04 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Tue Oct 13 12:22:09 2015 +0200
wiping: make libblkid detect all copies of the same signature if use_blkid_wiping=1
Some signatures are spread around the disk in several copies, mainly for
backup. Make libblkid to detect these extra copies - there was missing
"blkid_probe_step_back" fn call after successful wipe of previous signature
copy.
An example with FAT table which has copies:
$ mkfs.vfat /dev/sda1
Before this patch:
$ pvcreate /dev/sda1
WARNING: vfat signature detected on /dev/sda1 at offset 54. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
Physical volume "/dev/sda1" successfully created
With this patch applied:
$ pvcreate /dev/sda1
WARNING: vfat signature detected on /dev/sda1 at offset 54. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
WARNING: vfat signature detected on /dev/sda1 at offset 0. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
WARNING: vfat signature detected on /dev/sda1 at offset 510. Wipe it? [y/n]: y
Wiping vfat signature on /dev/sda1.
Physical volume "/dev/sda1" successfully created
---
WHATS_NEW | 1 +
lib/device/dev-type.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5fa6e7f..f683456 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.133 -
======================================
+ Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
Fix vgimportclone with -n to not add number unnecessarily to base VG name.
Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr.
Add vg_missing_pv_count report field to report number of missing PVs in a VG.
diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
index 25f11d1..1d03024 100644
--- a/lib/device/dev-type.c
+++ b/lib/device/dev-type.c
@@ -651,8 +651,13 @@ static int _wipe_known_signatures_with_blkid(struct device *dev, const char *nam
BLKID_SUBLKS_BADCSUM);
while (!blkid_do_probe(probe)) {
- if ((r_wipe = _blkid_wipe(probe, dev, name, types_to_exclude, types_no_prompt, yes, force)) == 1)
+ if ((r_wipe = _blkid_wipe(probe, dev, name, types_to_exclude, types_no_prompt, yes, force)) == 1) {
(*wiped)++;
+ if (blkid_probe_step_back(probe)) {
+ log_error("Failed to step back blkid probe to check just wiped signature.");
+ goto out;
+ }
+ }
/* do not count excluded types */
if (r_wipe != 2)
found++;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5bd63df237bc3426…
Commit: 5bd63df237bc3426d1ebd41b103430063846b3ab
Parent: 75420282e17e44d5c7b56126a5c7fd170f0ef417
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon Oct 12 12:54:35 2015 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Oct 12 12:55:39 2015 +0200
tests: test vgimportclone and -n option
---
test/shell/vgimportclone.sh | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/test/shell/vgimportclone.sh b/test/shell/vgimportclone.sh
index 0b1af38..53c8b00 100644
--- a/test/shell/vgimportclone.sh
+++ b/test/shell/vgimportclone.sh
@@ -71,3 +71,28 @@ lvchange -ay $vg1/$lv1 $vg2/$lv1
vgchange -an $vg1 $vg2
vgremove -ff $vg1 $vg2
+
+# Verify that if we provide the -n|--basevgname,
+# the number suffix is not added unnecessarily.
+vgcreate --metadatasize 128k A${vg1}B "$dev1"
+
+# vg1B is not the same as Avg1B - we don't need number suffix
+dd if="$dev1" of="$dev2" bs=256K count=1
+aux notify_lvmetad "$dev2"
+vgimportclone -n ${vg1}B "$dev2"
+check pv_field "$dev2" vg_name ${vg1}B
+
+# Avg1 is not the same as Avg1B - we don't need number suffix
+dd if="$dev1" of="$dev2" bs=256K count=1
+aux notify_lvmetad "$dev2"
+vgimportclone -n A${vg1} "$dev2"
+check pv_field "$dev2" vg_name A${vg1}
+
+# Avg1B is the same as Avg1B - we need to add the number suffix
+dd if="$dev1" of="$dev2" bs=256K count=1
+aux notify_lvmetad "$dev2"
+vgimportclone -n A${vg1}B "$dev2"
+aux vgs
+check pv_field "$dev2" vg_name A${vg1}B1
+
+vgremove -ff A${vg1}B A${vg1}B1