[Devel] [PATCH RHEL7 COMMIT] ploop: push_backup: ploop_pb_init must always spawn health_monitor

Konstantin Khorenko khorenko at virtuozzo.com
Mon Nov 28 06:31:43 PST 2016


The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.6
------>
commit c2530e9173db53fa81db517c170d966e9cbf5f2f
Author: Maxim Patlasov <mpatlasov at virtuozzo.com>
Date:   Mon Nov 28 18:31:43 2016 +0400

    ploop: push_backup: ploop_pb_init must always spawn health_monitor
    
    Due to a silly mistake, ploop_pb_init forgot to spawn health_monitor thread
    for full backup. The aftermath is disastrous in case of slow/hanged
    vz_backup_client: push_backup timeout handler moves backup state from
    ALIVE to STOPPING, but nobody finalizes hanged requests and moves the
    state to DEAD (as expected from health_monitor).
    
    Signed-off-by: Maxim Patlasov <mpatlasov at virtuozzo.com>
---
 drivers/block/ploop/push_backup.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/block/ploop/push_backup.c b/drivers/block/ploop/push_backup.c
index 5afe643..975d2be 100644
--- a/drivers/block/ploop/push_backup.c
+++ b/drivers/block/ploop/push_backup.c
@@ -380,7 +380,6 @@ static int ploop_pb_health_monitor(void * data)
 int ploop_pb_init(struct ploop_pushbackup_desc *pbd, __u8 *uuid, bool full)
 {
 	struct task_struct *ts;
-	int rc;
 
 	memcpy(pbd->cbt_uuid, uuid, sizeof(pbd->cbt_uuid));
 
@@ -396,21 +395,20 @@ int ploop_pb_init(struct ploop_pushbackup_desc *pbd, __u8 *uuid, bool full)
 			__clear_bit(off, page_address(pbd->ppb_map[i]));
 			off++;
 		}
-		return 0;
+	} else {
+		int rc = blk_cbt_map_copy_once(pbd->plo->queue,
+					       uuid,
+					       &pbd->cbt_map,
+					       &pbd->cbt_block_max,
+					       &pbd->cbt_block_bits);
+		if (rc)
+			return rc;
+
+		rc = convert_map_to_map(pbd);
+		if (rc)
+			return rc;
 	}
 
-	rc = blk_cbt_map_copy_once(pbd->plo->queue,
-				   uuid,
-				   &pbd->cbt_map,
-				   &pbd->cbt_block_max,
-				   &pbd->cbt_block_bits);
-	if (rc)
-		return rc;
-
-	rc = convert_map_to_map(pbd);
-	if (rc)
-		return rc;
-
 	ts = kthread_create(ploop_pb_health_monitor, pbd, "ploop_pb_hm%d",
 			    pbd->plo->index);
 	if (IS_ERR(ts))


More information about the Devel mailing list