Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=872ea3b98710c2a4…
Commit: 872ea3b98710c2a45c76dc22a606a40b13440d13
Parent: df110bccbed2bc7f53355fcb16309eb2727ba483
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Sep 3 22:57:50 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Sep 3 23:34:36 2015 +0200
thin: do not flush when quering for thin percent
Since we may easily get blocked when checking for percentage
of thin-pool - do not flush and just show current values.
This avoids holding VG locked when pool is overfilled.
---
WHATS_NEW | 1 +
lib/activate/dev_manager.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index cb9e1f1..6336f45 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.130 -
===================================
+ Read thin-pool data and metadata percent without flush.
Detect blocked thin-pool and avoid scanning their thin volumes.
Check if dm device is usable before checking its size (2.02.116).
Extend parsing of cache_check version in configure.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 6a26d37..d4a349b 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -1045,6 +1045,11 @@ static int _percent_run(struct dev_manager *dm, const char *name,
wait ? DM_DEVICE_WAITEVENT : DM_DEVICE_STATUS, 0, 0, 0)))
return_0;
+ /* No freeze on overfilled thin-pool, read existing slightly outdated data */
+ if (lv && lv_is_thin_pool(lv) &&
+ !dm_task_no_flush(dmt))
+ log_warn("Can't set no_flush flag."); /* Non fatal */
+
if (!dm_task_run(dmt))
goto_out;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=81a9da8f6190b567…
Commit: 81a9da8f6190b567bb26f28ff02be0e6b10cad9a
Parent: a3c7e326c3e9950fe74e433c406d6e1b5a53bf25
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 2 16:08:30 2015 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Sep 3 23:34:36 2015 +0200
filters: swap device_is_usable test
Fix regression introduced with commit:
2fc126b00d83991c6a2f3ed9aa61457294a4c45e
This commit has moved pv_min_size() test in front
of device_is_usable(). However pv_min_size needs to open device,
so it may have actually get blocked.
So restore the original order and first validate
dm device to be usable for open.
It's worth to note that such check is not 'race-free',
but it usually eliminates 99.99% of problems ;).
---
WHATS_NEW | 2 ++
lib/filters/filter-usable.c | 40 ++++++++++++++++++++--------------------
2 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 48b2a07..a7c7267 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.130 -
===================================
+ Check if dm device is usable before checking its size (2.02.116).
+ Extend parsing of cache_check version in configure.
Make lvpoll error messages visible in lvmpolld's stderr and in syslog.
Add 'make install_full_man' to install all man pages regardless of config.
diff --git a/lib/filters/filter-usable.c b/lib/filters/filter-usable.c
index e39cb54..9377661 100644
--- a/lib/filters/filter-usable.c
+++ b/lib/filters/filter-usable.c
@@ -112,26 +112,11 @@ static int _passes_usable_filter(struct dev_filter *f, struct device *dev)
{
filter_mode_t mode = *((filter_mode_t *) f->private);
struct dev_usable_check_params ucp = {0};
- int r;
-
- /* check if the device is not too small to hold a PV */
- switch (mode) {
- case FILTER_MODE_NO_LVMETAD:
- /* fall through */
- case FILTER_MODE_PRE_LVMETAD:
- if (!_check_pv_min_size(dev))
- return 0;
- break;
- case FILTER_MODE_POST_LVMETAD:
- /* nothing to do here */
- break;
- }
+ int r = 1;
/* further checks are done on dm devices only */
- if (!dm_is_dm_major(MAJOR(dev->dev)))
- return 1;
-
- switch (mode) {
+ if (dm_is_dm_major(MAJOR(dev->dev))) {
+ switch (mode) {
case FILTER_MODE_NO_LVMETAD:
ucp.check_empty = 1;
ucp.check_blocked = 1;
@@ -160,10 +145,25 @@ static int _passes_usable_filter(struct dev_filter *f, struct device *dev)
ucp.check_error_target = 0;
ucp.check_reserved = 0;
break;
+ }
+
+ if (!(r = device_is_usable(dev, ucp)))
+ log_debug_devs("%s: Skipping unusable device.", dev_name(dev));
}
- if (!(r = device_is_usable(dev, ucp)))
- log_debug_devs("%s: Skipping unusable device", dev_name(dev));
+ if (r) {
+ /* check if the device is not too small to hold a PV */
+ switch (mode) {
+ case FILTER_MODE_NO_LVMETAD:
+ /* fall through */
+ case FILTER_MODE_PRE_LVMETAD:
+ r = _check_pv_min_size(dev);
+ break;
+ case FILTER_MODE_POST_LVMETAD:
+ /* nothing to do here */
+ break;
+ }
+ }
return r;
}