Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fe65a86cbc98bb38…
Commit: fe65a86cbc98bb38014b238266a7732de42d0aa1
Parent: 07a60b59f789e089761170f977defbd38defacef
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Apr 11 10:08:16 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Apr 11 10:33:14 2016 +0200
devcache: do not insert devices without device node
When not obtaining device from udev, we are doing deep devdir scan,
and at the same time we try to insert everything what /sys/dev/block
knows about. However in case lvm2 is configured to use nonstardard
devdir this way it will see (and scan) devices from a real system.
lvm2 test suite is using its own test devdir with its
own device nodes. To avoid touching real /dev devices, validate
the device node exist in give dir and do not insert such device
into a cache.
With obtain list from udev this patch has no effect
(the normal user path).
---
WHATS_NEW | 1 +
lib/device/dev-cache.c | 9 +++++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 777c44e..f4eb6ad 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.151
=================================
+ When not obtaining devs from udev, check they exist before caching them.
Detect device mismatch also when compiling without udev support.
Version 2.02.150 - 9th April 2016
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 84471ab..6abb6a7 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -433,6 +433,8 @@ static struct dm_list *_get_or_add_list_by_index_key(struct dm_hash_table *idx,
static struct device *_insert_sysfs_dev(dev_t devno, const char *devname)
{
+ static struct device _fake_dev = { .flags = DEV_USED_FOR_LV };
+ struct stat stat0;
char path[PATH_MAX];
char *path_copy;
struct device *dev;
@@ -442,6 +444,13 @@ static struct device *_insert_sysfs_dev(dev_t devno, const char *devname)
return NULL;
}
+ if (lstat(path, &stat0) < 0) {
+ /* When device node does not exist return fake entry.
+ * This may happen when i.e. lvm2 device dir != /dev */
+ log_debug("%s: Not available device node", path);
+ return &_fake_dev;
+ }
+
if (!(dev = _dev_create(devno)))
return_NULL;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=eadbe39b7a9017c6…
Commit: eadbe39b7a9017c63cec232c2f62717048f551f1
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-04-09 01:09 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-04-09 01:09 +0000
annotated tag: v2_02_150 has been created
at eadbe39b7a9017c63cec232c2f62717048f551f1 (tag)
tagging 3aab784aa5cbbe4f86cbc1c8a33579dc32c991eb (commit)
replaces v2_02_149
Release 2.02.150
A small bug-fix release.
24 files changed, 262 insertions(+), 139 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlcIVm4ACgkQIoGRwVZ+LBe1DQCgg02s7rQe1ll+DpzphKvqXTpw
GQIAn3X5HiuGNflwPFs28bBd3RGyXqmd
=FTsd
-----END PGP SIGNATURE-----
Alasdair G Kergon (6):
post-release
lvmdump: Allow dir to exist already if it is empty
lvmdump: If dir exists check dir perms too.
libdm: Correct typo.
activation: Skip another non-prefixed info ioctl.
pre-release
Marian Csontos (1):
test: Fix testing of installed lvmdbusd
Peter Rajnoha (3):
cleanup: use #define for field's quote and pair character and also for the error msg while extending output line
cleanup: use common init/destroy_processing_handle in _report fn and cleanup error paths
report: remove superfluous SEGSSTATUS report type
Zdenek Kabelac (17):
mirror: fix flushing for mirror target
suspend: fix suspend with noflush limitation
preload: preserve flushing state
libdm: improve debug message with ioctl
lvconvert: show percent with %.2
cleanup: indent
tests: verify repair of failing mirror
tests: do not break teardown on failing losetup
WHATS_NEW: update
lvcreate: %FREE -> %PVS
activation: do not check for devs without LVM-
tests: use mkfs.ext3
tests: require newer cache target
dev_manager: device_is_usable does not flush
cleanup: reuse _setup_task
cleanup: simplier to read condition
cleanup: avoid gcc warns
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a09d65891fcf9713…
Commit: a09d65891fcf97130dd595eba320b647638d9a07
Parent: f40dfb48ad0114c89ac5fc0a8670a3792565e9a9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Apr 8 16:00:03 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Apr 8 20:20:04 2016 +0200
dev_manager: device_is_usable does not flush
When scanning if device is being usable as PV,
we call STATUS - but this status should not cause
any flushing.
Skip also open_count information as it's not needed.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 21970a8..0fa9f50 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.150 -
=================================
+ Avoid using flushing dm status ioctl when checking for usable DM device.
Check for devices without LVM- uuid prefix only with kernels < 3.X.
Reuse %FREE size aproximation with lvcreate -l%PVS thin-pool.
Allow the lvmdump directory to exist already provided it is empty.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 89fa9e9..f2e3826 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -553,7 +553,14 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check)
if (activation_checks() && !dm_task_enable_checks(dmt))
goto_out;
-
+
+ /* Non-blocking status read */
+ if (!dm_task_no_flush(dmt))
+ log_warn("WARNING: Can't set no_flush for dm status.");
+
+ if (!dm_task_no_open_count(dmt))
+ goto_out;
+
if (!dm_task_run(dmt)) {
log_error("Failed to get state of mapped device");
goto out;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8b2108e6b16cbcb5…
Commit: 8b2108e6b16cbcb528a138413e9050dd6f420e0d
Parent: 097a724bda160e4c0b5c7760e7a710d3e00b898c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 7 21:37:26 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Apr 7 22:32:08 2016 +0200
activation: do not check for devs without LVM-
Devices without "LVM-" uuid prefix have been generated by very old
version of lvm2 2.00 and 2.01.
Since version 2.02 all lvm2 devices are using prefix "LVM-".
However checking for present of ancient non prefixed devices does
take extra IOCTL per every call and for majority of todays user
it will not find anything new.
So use the assumption that users with kernel 3.X and newer are not
really using such old versions of lvm2 (year <2005) and with their
new kernel they are also using new version of lvm2 and skip
checking for them.
This change also makes trace logs more readable.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8387eab..21970a8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.150 -
=================================
+ Check for devices without LVM- uuid prefix only with kernels < 3.X.
Reuse %FREE size aproximation with lvcreate -l%PVS thin-pool.
Allow the lvmdump directory to exist already provided it is empty.
Show lvconverted percentage with 2 decimal digits.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index b3e97db..18e2081 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -29,6 +29,7 @@
#include <limits.h>
#include <dirent.h>
+#include <sys/utsname.h>
#define MAX_TARGET_PARAMSIZE 50000
#define LVM_UDEV_NOSCAN_FLAG DM_SUBSYSTEM_UDEV_FLAG0
@@ -674,6 +675,24 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check)
return r;
}
+/* Returns 1 for kernels >= 3.X, otherwise 0 */
+static int _check_new_kernel(void)
+{
+ static int major = 0;
+ struct utsname _uts;
+
+ if (!major) {
+ if (uname(&_uts) ||
+ (sscanf(_uts.release, "%d", &major) != 1))
+ major = 1;
+ else if (major >= 3)
+ log_debug("Not checking for devices without prefix "
+ UUID_PREFIX " with newer kernel.");
+ }
+
+ return (major >= 3);
+}
+
static int _info(const char *dlid, int with_open_count, int with_read_ahead,
struct dm_info *dminfo, uint32_t *read_ahead,
struct lv_seg_status *seg_status)
@@ -703,6 +722,10 @@ static int _info(const char *dlid, int with_open_count, int with_read_ahead,
}
}
+ /* With kernels > 3.X skip checking for devices without UUID_PREFIX */
+ if (_check_new_kernel())
+ return r;
+
/* Check for dlid before UUID_PREFIX was added */
if ((r = _info_run(seg_status ? STATUS : INFO, NULL, dlid + sizeof(UUID_PREFIX) - 1,
dminfo, read_ahead, seg_status, with_open_count,
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=097a724bda160e4c…
Commit: 097a724bda160e4c0b5c7760e7a710d3e00b898c
Parent: e2d4f53c827a14597e51956adb2202d32660f54c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Apr 7 11:12:49 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Apr 7 22:32:08 2016 +0200
lvcreate: %FREE -> %PVS
This is hotfix for RHBZ: https://bugzilla.redhat.com/1324537
However already the %FREE is not a good fit and we need something
better. Meanwhile make -l%PVS work at least as good as %FREE
for thin-pool.
TODO: this needs rework - it should be allocator to do all the size
decisions at one place.
---
WHATS_NEW | 1 +
tools/lvcreate.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0c940b6..8387eab 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.150 -
=================================
+ Reuse %FREE size aproximation with lvcreate -l%PVS thin-pool.
Allow the lvmdump directory to exist already provided it is empty.
Show lvconverted percentage with 2 decimal digits.
Fix regression in suspend when repairing --type mirror (2.02.133).
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 283e52a..9714789 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -368,7 +368,7 @@ static int _update_extents_params(struct volume_group *vg,
&lp->discards, &lp->zero))
return_0;
- if (lcp->percent == PERCENT_FREE) {
+ if (lcp->percent == PERCENT_FREE || lcp->percent == PERCENT_PVS) {
if (lp->extents <= (2 * lp->pool_metadata_extents)) {
log_error("Not enough space for thin pool creation.");
return 0;