summaryrefslogtreecommitdiffstats
path: root/daemons/clvmd/lvm-functions.c
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2010-01-19 13:25:00 +0000
committerMilan Broz <mbroz@redhat.com>2010-01-19 13:25:00 +0000
commit7a965168193968fd1a34c766f0b435e4f08ef4ac (patch)
tree79620362507ccdabbce1e2f26546916f3829e922 /daemons/clvmd/lvm-functions.c
parent81410c8f097d568c732d90e07284218ac297fe8d (diff)
downloadlvm2-7a965168193968fd1a34c766f0b435e4f08ef4ac.tar.gz
lvm2-7a965168193968fd1a34c766f0b435e4f08ef4ac.tar.xz
lvm2-7a965168193968fd1a34c766f0b435e4f08ef4ac.zip
Never scan suspended devices in clvmd.
For mirror repair (and similar tasks) it can happen that full device rescan is issued from clvmd. Because code can be in the middle of repair (calling suspend) clvmd should never try to scan suspended devices (otherwise it causes deadlock). Also code must not change ignore_suspended_device flag when doing refresh_filters (called from lvmcache scan code).
Diffstat (limited to 'daemons/clvmd/lvm-functions.c')
-rw-r--r--daemons/clvmd/lvm-functions.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c
index afe93e2f..74c660ea 100644
--- a/daemons/clvmd/lvm-functions.c
+++ b/daemons/clvmd/lvm-functions.c
@@ -499,6 +499,9 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource)
cmd->partial_activation = (lock_flags & LCK_PARTIAL_MODE) ? 1 : 0;
+ /* clvmd should never try to read suspended device */
+ init_ignore_suspended_devices(1);
+
switch (command & LCK_MASK) {
case LCK_LV_EXCLUSIVE:
status = do_activate_lv(resource, lock_flags, LKM_EXMODE);
@@ -627,6 +630,7 @@ int do_refresh_cache()
}
init_full_scan_done(0);
+ init_ignore_suspended_devices(1);
lvmcache_label_scan(cmd, 2);
dm_pool_empty(cmd->mem);
@@ -860,6 +864,7 @@ int init_lvm(int using_gulm)
/* Check lvm.conf is setup for cluster-LVM */
check_config();
+ init_ignore_suspended_devices(1);
/* Remove any non-LV locks that may have been left around */
if (using_gulm)