From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 7863580027 for ; Mon, 23 Nov 2026 15:38:22 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6ANFbBQl021255; Mon, 23 Nov 2026 18:37:12 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ANFbBQl021255 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=default; t=1795448233; bh=ba19lCLET77qHYsIKb3hknFUjXo8CpgC0WL3i4o2xKc=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe; b=ceuJerg5/OKbZ9yE8xAGOYjEtQwrB+BGMcdUUSJn1722Eoh9Bzz6MxVlZhWPvHzSC mRfIrmz0lc+gWZSU6TiQfAI+Z+imzSzasW+FE3rWFHKZS6aYGgiJPsL2rsTL57VDvY Qz0qrkVP5yUXYC5uie6r6T7nrTVG9n2WRDOXPp14q0WVyxH5UAOelbBdpdrbV3BHpQ wVGnFhxPJiSsRuHh7ENRXDDqwtC9VuT75yqrhaHvv/vdNg+/KL8pzD1jr2oeWtho8l 2mrGB6l30B5acEUFZokUJMfbK9de3P2N3DzKYoYHQCzm+3oxPkzzAAc/yf9pZQMPWx hWSo8p+bp/8VQ== Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6ANFascP021183 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 23 Nov 2026 18:36:54 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6ANFascP021183 Authentication-Results: mail.openvz.org; dkim=pass (2048-bit key) header.d=openvz.org header.i=@openvz.org header.b="E6gJ1WK7" Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-49034831bb3so2156732f8f.1 for ; Mon, 23 Nov 2026 07:36:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErHvsSq6nJF8ot+d0Bc8X/US3vsgM/OefyHOakAZDrJFpjW4W0tLsmDrmnft/xtj5497RzGF7A==@openvz.org X-Gm-Message-State: APuU4Z9ZHvlYTzWJrzABslfpucILmLi/e05KLURulaJLbraUT0LDVN8l OGrQeMVBphdAZFNG3dIzfqYOO7SRICxI6HTOROw5Pyho8Rx8eygvhfgRuIuSXvIHXEBZIbG5gr1 zt1fjFn89mev039AvWTyRs8z6RyytQNX4phuP4mpEC6rHgBQ4utdI3Q== X-Gm-Gg: AZFdTZdAIN0SY9y34SPlK7qcAHfRtGtCim3p53hzUYuUiGiBDNyV1HmoZuKu5YLRqr9 rLWS/gOhNlxZAO/lac4j8UXcVy5sxWsvCw9makPA38npsJLxMH9IZ8NE3CawI8LD3RuS/x7H183 nUAJggnLqKi7oWYpRNlQlt06aXkQp0oypsCAdztb3jOWn1FcVWFfVdg3Nu06kBQru3Qnyz0yVBP z18WfU1dTUJsDOgCQhVAumGk9Orq4jirHTI1w83nhBmxeUftADn4g0300OHwpKu0snkkQXf5VQ8 u19lvvTLnA== X-Received: by 2002:a05:600c:64c8:b0:4bb:68e5:b952 with SMTP id 5b1f17b1804b1-4bb88819be1mr229057725e9.16.1795448214190; Mon, 23 Nov 2026 07:36:54 -0800 (PST) X-Received: by 2002:a05:600c:64c8:b0:4bb:68e5:b952 with SMTP id 5b1f17b1804b1-4bb88819be1mr229057315e9.16.1795448213751; Mon, 23 Nov 2026 07:36:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795448213; cv=none; d=google.com; s=arc-20260327; b=I++ebDSfGf1POS0YHjRIb2rtcVpIiovsQl9HbnXJngsF8rMJdkPPHLNDLnloQIHWtf Ny8oWCCBp4G3v9guGKV3lxX0BlzNj44Cu/+54gD0VTAMaWF5WZLsYpGERwH1gpv3fCg/ gj3lNpyj94vnEdzb8x5VhyxGrgEMR0qvVlwIDx6dSZ0e5JVN59LtqINlKkwtPYpHsluv vi1JiqykOmsyAKly9UzSQbBcrq25tVtUotqjM8Z03UQK9XtlpzH6drhqHV5v7LwGhQAH Q6L4Gfb52eeHFo7eOQ6BrJUC5YtJ25l+TD+Ay4ab6BWwmuUeCTuidyc8mTwi8swDChKe VOjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=hLpP1L+FYRGnp0ZOPld7BG4rfInc1F8l/Heo50nEpRY=; fh=8yq51R/6h0EZiWk7H7uTnEOPsM+JcY06hVggvGTx2qs=; b=lJrMQoPHx/wfPRTma0ANOeFsQPgmLYuOiiZlOv22Ip+nViu1QAiZbdiotNjxufoil6 vDFIqKqHQXStKWLs+SEoXbp6HoUACW5N43cshNQ3/p7/RlXMWzGB/39evXH/w7wJIoGV 6fTdfXL1+PNi/OTBycEGV3wKcE8map3c11bn202fxvEujlbB+zzDqAowgtmNVrjOC/IT 6Fo4G2e1Dy/l3Gj0b78PvHC21fhJo8uPCTw/dLjYOj324kPd9PeuExT0UvXxKKqw4u1l oiStxF66kFq/BDQZ0I9k/g1w6Vgh+PNQRGzVLSdgCqVz/fpHnZ6a0gZCrSSKbGea1qTq G5Tw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=E6gJ1WK7; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:62d2:2eda:8655:4219 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id ffacd0b85a97d-4ab5b24d9a0sor1849456f8f.5.2026.11.23.07.36.53 for (Google Transport Security); Mon, 23 Nov 2026 07:36:53 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:62d2:2eda:8655:4219 as permitted sender) client-ip=2a06:5b06:b600:300:62d2:2eda:8655:4219; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz.org header.s=google header.b=E6gJ1WK7; spf=softfail (google.com: domain of transitioning den@openvz.org does not designate 2a06:5b06:b600:300:62d2:2eda:8655:4219 as permitted sender) smtp.mailfrom=den@openvz.org; dara=neutral header.i=@openvz.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1795448213; x=1796053013; darn=openvz.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hLpP1L+FYRGnp0ZOPld7BG4rfInc1F8l/Heo50nEpRY=; b=E6gJ1WK7XKC8W9rqUdtaSTmMeEDJEAfZYqgP/Z8v2TN8Px5mhLTCC+ej1lNIBtofRQ iNDk2/ooo34hROmMn0CgMoLFyP9gYvxOZncASdQ8Y5sjKtsQIpOe3xXYcpjVjcAoa97E VcydK1iBrr8nNE6I9q+bOU5lRQOG2oR/Qwbhb+kJweT73TVAxsGgKbQXnNE86j9N9m0Z M0GHJm4Zj816Ip8SXaz3/J1x+DLZXa59Yc4en5DAhR8hL2nLbTyFQPppMq7jqbo7mVxT XcJHOoOe1wystrQtt4PpQj5Nc3vnRGAyVF9qXuADBmWrkM53lWWsJKhIUhrvstFqu4G+ mjZQ== X-Forwarded-Encrypted: i=1; AL+hErEvAETVZKg9f+7/uMqYJvqkriZ4ozMBRJSCt3zkMCLZeQigwYNO8lpPzvoHv3RnbqkHBSFAQg==@openvz.org X-Received: by 2002:a05:600c:37c6:b0:4bb:7033:c938 with SMTP id 5b1f17b1804b1-4bb888147b7mr240781915e9.14.1795448213255; Mon, 23 Nov 2026 07:36:53 -0800 (PST) Received: from artemis.sw.ru ([2a06:5b06:b600:300:62d2:2eda:8655:4219]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb884b7515sm491797455e9.13.2026.11.23.07.36.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2026 07:36:52 -0800 (PST) From: "Denis V. Lunev" To: andrey.zhadchenko@virtuozzo.com, alexander.ivanov@virtuozzo.com, vasileios.almpanis@virtuozzo.com Date: Mon, 23 Nov 2026 16:36:40 +0100 Message-ID: <20261123153640.128227-9-den@openvz.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261123153640.128227-1-den@openvz.org> References: <20261123153640.128227-1-den@openvz.org> MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v2 8/8] dm-qcow2: flush the backward merge work before freeing the target X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org From: Denis V. Lunev qcow2_merge_backward_work() runs on the system workqueue and ends by setting the merge state under ctl_mutex and unlocking it. A qcow2_merge_backward_cancel() that sees BACKWARD_MERGE_STOPPED, or turns BACKWARD_MERGE_WAIT_COMPLETION into it, returns without flush_work(), so it can take ctl_mutex while the work is still inside mutex_unlock(). qcow2_tgt_destroy() then frees the target, and the mutex in it, under that unlock. Flush the merge work in qcow2_tgt_destroy() after the cancel, whatever state the merge is in. https://virtuozzo.atlassian.net/browse/VSTOR-156036 Fixes: 7d2cf9a7c178 ("dm-qcow2: make merge_backward command asyncronous") Feature: dm-qcow2: block device over QCOW2 files driver Signed-off-by: Denis V. Lunev --- drivers/md/dm-qcow2-target.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c index 9c173e1dce87..5a18738d5b89 100644 --- a/drivers/md/dm-qcow2-target.c +++ b/drivers/md/dm-qcow2-target.c @@ -245,6 +245,7 @@ static void qcow2_tgt_destroy(struct qcow2_target *tgt) unsigned int i; qcow2_merge_backward_cancel(tgt); + flush_work(&tgt->backward_merge.work); timer_shutdown_sync(&tgt->enospc_timer); /* -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel