summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2014-10-08 10:57:44 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2014-10-08 11:03:08 +0200
commitc87e5a308a95e6e7c2d120ce816df14644f8e70a (patch)
tree6fe37cf46f62326234da082647a914412b574c82
parentf3bb1c018f7b6e38f0351a9994760bae7d9f00e3 (diff)
downloadlvm2-c87e5a308a95e6e7c2d120ce816df14644f8e70a.tar.gz
filter-usable: filter out blocked and suspended devices firmly when scanning for lvmetad
We can't hang on blocked or suspended devices when the scan is done for lvmetad update - when the device gets unblocked or resumed, there's always CHANGE event generated which will fire the udev rule to run extra pvscan --cache for that device which makes sure that lvmetad is up-to-date.
-rw-r--r--lib/filters/filter-usable.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/filters/filter-usable.c b/lib/filters/filter-usable.c
index 2a7ef495d..a6932b05e 100644
--- a/lib/filters/filter-usable.c
+++ b/lib/filters/filter-usable.c
@@ -36,8 +36,15 @@ static int _passes_usable_filter(struct dev_filter *f, struct device *dev)
break;
case FILTER_MODE_PRE_LVMETAD:
ucp.check_empty = 1;
- ucp.check_blocked = 0;
- ucp.check_suspended = ignore_suspended_devices();
+ /*
+ * If we're scanning for lvmetad update,
+ * we don't want to hang on blocked/suspended devices.
+ * When the device is unblocked/resumed, surely,
+ * there's going to be a CHANGE event so the device
+ * gets scanned via udev rule anyway after resume.
+ */
+ ucp.check_blocked = 1;
+ ucp.check_suspended = 1;
ucp.check_error_target = 1;
ucp.check_reserved = 1;
break;