From e4dfa785d14643e1efd298af1040f461704b0a67 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 30 May 2013 11:19:28 +0200 Subject: [PATCH] libdm: compensate suspend counter for live table This patch may not be fully correct. It tries to solve the imbalanced suspend counter. The problem starts when some LV is created and fails in resume path. (i.e. resuming to large PV (enforced) over small loop devices) This fails in _resume_node() after dm_task_run(). And while existing device with empty table is left in inactive table, further calls are reporting this device is in suspend state. When later the lvm2 tries to rollback created device and deactivate it, it will end with internal error, when we try to decrement never incremented suspend counter. As an 'easy fix' for now update suspend counter only for live nodes. TODO: explore better fix. --- libdm/libdm-deptree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 2201b30d7..4482296e1 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -1598,7 +1598,7 @@ static int _dm_tree_deactivate_children(struct dm_tree_node *dnode, info.minor); r = 0; continue; - } else if (info.suspended) + } else if (info.suspended && info.live_table) dec_suspended(); if (child->callback &&