summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-04-08 16:00:03 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2016-04-08 20:20:04 +0200
commita09d65891fcf97130dd595eba320b647638d9a07 (patch)
tree783951995fb0fce9b35e872c729ce4313b04d8a0
parentf40dfb48ad0114c89ac5fc0a8670a3792565e9a9 (diff)
downloadlvm2-a09d65891fcf97130dd595eba320b647638d9a07.tar.gz
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.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/activate/dev_manager.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 21970a84e..0fa9f50cd 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 89fa9e900..f2e382605 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;