Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6129d2e64d140471…
Commit: 6129d2e64d14047169048775dc7081135c0fcc50
Parent: 82d92009ae37bea3cd6a3f754c25d56b12959676
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Mar 24 11:13:21 2016 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Mar 24 12:40:19 2016 +0100
monitoring: sync /dev content before contacting dmeventd for monitor/unmonitor
dmeventd daemon may call further code itself that looks at /dev, e.g.
via dmeventd_lvm2_command call. We need to have a consistent view of
the /dev content at that time. Therefore, sync /dev content before
calling monitoring hook which contacts dmeventd.
This problem was quite hidden before, but now it has manifested itself
because of recent additions to dev-cache code where we started looking
at device holders as seen in sysfs. What happened here was that the
device was already in sysfs, but not yet under /dev and this triggered
the new error message sometimes:
log_error("%s: failed to find associated device structure for holder %s.", devname, devpath);
This problem has manifested recently in our api/pytest.sh test from
testsuite where we create thin pool LVs and thin LVs and hence it also
causes dmeventd to be used as well and these error messages were
visible there.
---
lib/activate/activate.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 2eb24d4..7dce0da 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1746,6 +1746,12 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
if (test_mode())
continue;
+ /*
+ * Sync all queued device names/symlinks so dmeventd
+ * has consistent view during possible device scan.
+ */
+ fs_unlock();
+
/* FIXME specify events */
if (!monitor_fn(seg, 0)) {
log_error("%s: %s segment monitoring function failed.",
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=82d92009ae37bea3…
Commit: 82d92009ae37bea3cd6a3f754c25d56b12959676
Parent: 1b0775916b78e1270872d3649a2c9abf0a1bb790
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Mar 22 09:15:40 2016 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Wed Mar 23 12:27:34 2016 +0100
test: Move bus configuration to prepare function
---
test/api/dbustest.sh | 9 ---------
test/lib/aux.sh | 8 ++++++++
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/test/api/dbustest.sh b/test/api/dbustest.sh
index 79e3224..8741eb9 100644
--- a/test/api/dbustest.sh
+++ b/test/api/dbustest.sh
@@ -16,16 +16,7 @@ SKIP_WITH_CLVMD=1
. lib/inittest
-# Will default to skip until we can get this reviewed
-#skip
-
aux prepare_pvs 6
-# Copy the needed file to run on the system bus if it doesn't
-# already exist
-if [ ! -f /etc/dbus-1/system.d/com.redhat.lvmdbus1.conf ]; then
- install -m 644 $abs_top_builddir/scripts/com.redhat.lvmdbus1.conf /etc/dbus-1/system.d/.
-fi
-
aux prepare_lvmdbusd
$test_data_dir/dbus/lvmdbustest.py -v
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 2767880..9fd1922 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -306,6 +306,7 @@ prepare_lvmdbusd() {
kill_sleep_kill_ LOCAL_LVMDBUSD 0
+ # FIXME: This is not correct! Daemon is auto started.
echo "checking lvmdbusd is NOT running..."
if ps -elf | grep lvmdbusd | grep python3; then
echo "Cannot run while existing lvmdbusd process exists"
@@ -327,6 +328,13 @@ prepare_lvmdbusd() {
which python3 >/dev/null || skip "Missing python3"
python3 -c "import pyudev, dbus, gi.repository" || skip "Missing python modules"
+ # TODO: Tests should use session bus instead of system bus
+ # Copy the needed file to run on the system bus if it doesn't
+ # already exist
+ if [ ! -f /etc/dbus-1/system.d/com.redhat.lvmdbus1.conf ]; then
+ install -m 644 $abs_top_builddir/scripts/com.redhat.lvmdbus1.conf /etc/dbus-1/system.d/
+ fi
+
echo "preparing lvmdbusd..."
"$daemon" --debug --udev > debug.log_LVMDBUSD_out 2>&1 &
local pid=$!