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 A29D080033 for ; Mon, 30 Nov 2026 07:51:17 +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 6AU7ns9I006390; Mon, 30 Nov 2026 10:49:55 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AU7ns9I006390 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="SllcbuG8" Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AU7nqaF006384 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 30 Nov 2026 10:49:52 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AU7nqaF006384 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-6b4f1fcf171so3456250a12.1 for ; Sun, 29 Nov 2026 23:49:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErHBK56lqZryqMY5ppnbamwPNoZgO7umHk891Bh5EKA8QrIw4Av2GZ3xnx+89cFaH9r8Z29xGg==@openvz.org X-Gm-Message-State: APuU4Z+X+x7TYIW+mpLbi8cJBNWAzdL6US66+P+tY8E+vAqRoJAUuR3o RzKU5HskcekWKFwDmnq3uC3pKdjjR4S1E/yiqJODcELydi3BS7vNXF8inWtvioIw8/2D0Ofqy0+ c3zJXP8yXeFWnvsig3NWkIT+yW5sS6mpkFLl0YPrCynYfJs2R0mWIuQ== X-Gm-Gg: AZFdTZcwbYg6STvb9x5H+hV+Bx+wPfcAhLr1kppOaK7szTwwn2+Bn22kgwzJqeYB2OV gJmzsbWANNGJ0WA1uXaHsT+PbU13HW9Ge3otD0963z4sUV8O+rpVEVEMsr5XuX4BMl1ABaW3F+i yPYetqPxZ5QiwhAdleCMzpmcR6fXKwEDVNwTfq371juXgjqtNkneDNt1wzZeMU6nC3ZFgZ8zKTa PZDEyfI7r/+EXRjUPnNaDm4TnsKC5q8eKSPoNA484eVGvA/oZ9BOVDD9k8W7tXtxNVyfzDSsNgV 0LFwxPWDcqQjyE95HOAjjaWekTEyD2LmIK/wc+orIRtGRwwfRQBnkeHNKWl3+NtBkv76OztVGnj BjCrDL2aNri8m6GAlP/h/0voNWnfLoA== X-Received: by 2002:aa7:d355:0:b0:6b6:7231:7ebc with SMTP id 4fb4d7f45d1cf-6ba37d606e0mr18589820a12.14.1796024992403; Sun, 29 Nov 2026 23:49:52 -0800 (PST) X-Received: by 2002:aa7:d355:0:b0:6b6:7231:7ebc with SMTP id 4fb4d7f45d1cf-6ba37d606e0mr18589808a12.14.1796024991892; Sun, 29 Nov 2026 23:49:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796024991; cv=none; d=google.com; s=arc-20260327; b=Q258NA3HEzuJCIXYcYByGWGbiwTXgeyf8iMDyfeKb6QfHJBPZZSE1753SAcSMYCZp7 3XCyICrLOg1hIUpHyIaH9V6zn45Yvs5t6pUPkwESVX2POVmIIybPCBeMxrYl2ndRlUYR 17vvB5JykwPvoY5JUkw2K4WTQBKZp3aNBs/P6u5ukZzxDhlwDjnZ8DUkoWWIiCKqSYx2 N4cv6mZn8Y6fq0kbnfhqFlwcn6lffcqzP12ExPrzGDQ8QfU4fD4484djLpa2mHq5lGNQ VgR4TVW6Xo8Q8ZBrCuLEA5CDOEzvY2Nur0hEuj90gTE0zXit5Vc6wxrxpu7FeCYQag47 Hd4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:dkim-signature; bh=1mAOzSMHABb7yZtgag8tGmXdbBoujJxvA0jg1J56qCs=; fh=5o1eqOcenrMum7IxUnDhB/X5GjfA4fsbfWn53f7FGgU=; b=J0D8oOy+T9t8yCzpPmlV15tCsDM2gipd3G8rOvu+QJnbD9x4nhpg15Hcrf3F+gfb3Z +MqVWh9OQiF8gYb0KtU7HUyb7yVgjFaYqtJ3ne4nOyE7d291NES7hwkvLd1KCABy2g4p K0vlHwRzyyyB0LBg0lUIlda3abch+1YGeXWA50pMtMxO4oGm3U/+OFQmyiS3Vsj1QWb3 xwTt6l52o0NkkZ3RC1a7cNS+231EIt5C3n0gYQZVs93WbHmcmIzxtGYlpReG9nnjM67F JefWZMqsWCZP/yMxprWGOJH2qV+YNU4YSh4pGv+WuVA77HOmVOCCaR7C/TRaeogObMcE Fkng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=SllcbuG8; spf=pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vasileios.almpanis@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-6ba371586a3si26391638a12.86.2026.11.29.23.49.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 23:49:51 -0800 (PST) Received-SPF: pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=SllcbuG8; spf=pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vasileios.almpanis@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Content-Type:MIME-Version:Subject:Date :From; bh=1mAOzSMHABb7yZtgag8tGmXdbBoujJxvA0jg1J56qCs=; b=SllcbuG8wwb+X+rIUcQ ztnLmXte7ELGrE2EJbuZDLXhBtIAYWm4ok5W88U3mW0psLrL/wk5y8K505Df351NB24O18dpghXXJ KY1Y5s8CIUUP/xOoWZrP3XNy1D2KRDACZY8/zNeneA5n21iUtDuDImQCT/4NQMNZN9fob6X8Gu3qB YgXggQNkDzYiZ+OomzRwknR1BzHGDh4yoyknpxVbEHeCWigDnW2DOd0H3c/3CnWvTu7BUDksr5HjC EUWJPAIB6puNahDjXrEi+OsLGWJ/mQ2xxSq0NtVa0YkuiZFsdHP5TWECOg21wSf5PAke32niAbrid 48zKIiij6UiE9Jw==; Received: from [130.117.225.5] (helo=dev010.ch-qa.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xXw8i-00715X-2Q; Mon, 30 Nov 2026 08:49:43 +0100 From: Vasileios Almpanis Date: Mon, 30 Nov 2026 07:49:49 +0000 MIME-Version: 1.0 Message-Id: <20261130-push-backup-messages-v2-1-dfacc080f3a4@virtuozzo.com> X-B4-Tracking: v=1; b=H4sIAJwqDWsC/yWM0QrCMAwAf2Xk2QwXXBF/RXxos2yN4iyNlcHYv 6/q43HcrWCSVQwuzQpZPmr6mivQoQGOfp4EdagMdCTXdeQwFYsYPD9KwqeY+UkMhzGQ8707CTP UNGUZdfltrxBZ8dwS3P7CSrgLv79T2LYdUEyUKIEAAAA= X-Change-ID: 20261126-push-backup-messages-dfb26a564ecc To: Konstantin Khorenko X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796024991; l=7042; i=vasileios.almpanis@virtuozzo.com; s=20260812; h=from:subject:message-id; bh=b2DK05KvEVOGp8MR4y7yqNQyj2pDJbza5Fzu2Rwx4ss=; b=tyzr8J8MwbOLDUerwgSp0wwUIsYpjjYREQrPACOgIB1pPPVB2jiVjFDR0Uqx9rnW9b66Ezrng eVoM2VrLIfZDyLmBzOXjduucYgNeDC6Lhym/NmnfY3Ptokpj5k923iY X-Developer-Key: i=vasileios.almpanis@virtuozzo.com; a=ed25519; pk=HhuHDXAcPva9A8zccWEMRsb36reu+y4IVbBjXKxNUjw= X-OZ-Fwd: true Cc: Den Lunev , devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v2] dm/push_backup: remove the push_backup_read and push_backup_write messages 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 ploop-backup gets the ranges to back up and reports the backed up ranges through the event fd of the target since v10.0.16, with the change "dm: rework push_backup from messages to monitoring fd" (b9291ec in ploop-backup). The ploop tests use the event fd since "test: back up through the push_backup event fd" (008044b2 in ploop). Nothing else sends the push_backup_read and push_backup_write messages. push_backup_read is also the message that sleeps inside target_message() with md->io_barrier SRCU read locked, which is the reason the fd interface was added. Remove both messages, so that this path cannot be used again. An older ploop-backup still sends them, so the kernel spec now makes kernel-core conflict with ploop-backup older than 10.0.16, see "spec: Conflict with ploop-backup using push_backup_read/write messages" in vzkernel.vzspecs. Before it took ctl_rwsem for push_backup_stop, pb_message() cleared pb->alive and woke the waiters. Commit 20815dd41f13 ("dm/push_backup: Allow to stop push_backup at any time") added this so that a stop could wake a push_backup_read that slept holding ctl_rwsem. With push_backup_read gone, no reader waits under ctl_rwsem any more. The block also left a window where a push_backup_start that came in between was torn down by the waiting stop. Drop it and check argc in the push_backup_stop branch again. push_backup_write() stays, because pb_fd_write() uses it. It is now its only caller and never passes a NULL pb, so drop that check. Also drop the reference to the removed message from the comment of the fd write() in the uapi header, and bump the target version to 1.3.0. https://virtuozzo.atlassian.net/browse/VSTOR-155816 Feature: dm-backup: push backup target driver Signed-off-by: Vasileios Almpanis --- This is v2 of the third patch of the push_backup series. Patches 1 and 2 went on as their own v2, and this one comes separately now that the ploop test and the packaging are ready. ploop-backup uses the event fd since v10.0.16 and the ploop tests since ploop commit 008044b2. The kernel spec change "spec: Conflict with ploop-backup using push_backup_read/write messages" in vzkernel.vzspecs keeps an older ploop-backup off a node with this kernel. I tested the patch on 8.2 with a debug kernel with KASAN, lockdep and kmemleak enabled, on top of the v2 of patches 1 and 2. The tests covered the removed messages, push_backup_stop with and without a session, a stop that wakes a reader blocked on the event fd, concurrent start and stop, a backup through the event fd and the ploop push_backup tests. KASAN, lockdep and kmemleak reported nothing. https://virtuozzo.atlassian.net/browse/VSTOR-155816 --- Changes in v2: - Move the ploop test to the event fd first and name ploop-backup v10.0.16 and the ploop change instead of the kernel commit. - Make kernel-core conflict with older ploop-backup in the kernel spec. - Drop the push_backup_stop step before ctl_rwsem in pb_message() and check argc in the push_backup_stop branch again. - Drop the dead NULL check in push_backup_write() and bump the target version to 1.3.0. - Link to v1: http://lore.virtuozzo.com/20261125-push-backup-fixes-v1-3-8d5cc55c30a1@virtuozzo.com --- drivers/md/dm-push-backup.c | 43 ++----------------------------------- include/uapi/linux/dm-push-backup.h | 5 ++--- 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/drivers/md/dm-push-backup.c b/drivers/md/dm-push-backup.c index 745ed28fd074..0b313b2bd319 100644 --- a/drivers/md/dm-push-backup.c +++ b/drivers/md/dm-push-backup.c @@ -548,24 +548,6 @@ static int pb_wait_range(struct push_backup *pb, u64 *clu, u64 *nr) } } -static int push_backup_read(struct push_backup *pb, - char *result, unsigned int maxlen) -{ - unsigned int sz = 0; - u64 clu, nr; - int ret; - - if (!pb) - return -EBADF; - - ret = pb_wait_range(pb, &clu, &nr); - if (ret == -ERESTARTSYS) - ret = -EINTR; - if (ret == 1) - DMEMIT("%llu:%llu", clu, nr); - return ret; -} - static int push_backup_write(struct push_backup *pb, u64 clu, u64 nr) { u64 i, key, nr_clus = pb->nr_clus; @@ -573,8 +555,6 @@ static int push_backup_write(struct push_backup *pb, u64 clu, u64 nr) bool finished; struct pb_bio *pbio; - if (!pb) - return -EBADF; if (clu >= nr_clus || nr > nr_clus - clu) return -E2BIG; @@ -751,19 +731,6 @@ static int pb_message(struct dm_target *ti, unsigned int argc, char **argv, if (argc < 1) goto out; - if (!strcmp(argv[0], "push_backup_stop")) { - if (argc != 1) - goto out; - - if (!pb->map) - return -EBADF; - - spin_lock_irq(&pb->lock); - pb->alive = false; - spin_unlock_irq(&pb->lock); - wake_up_interruptible(&pb->waitq); /* pb->alive = false */ - } - write = msg_wants_down_write(argv[0]); if (write) ret = down_write_killable(&pb->ctl_rwsem); @@ -787,15 +754,9 @@ static int pb_message(struct dm_target *ti, unsigned int argc, char **argv, if (!ret && argc == 4) pb_watch_pid(pb); } else if (!strcmp(argv[0], "push_backup_stop")) { - ret = push_backup_stop(pb, result, maxlen); - } else if (!strcmp(argv[0], "push_backup_read")) { if (argc != 1) goto unlock; - ret = push_backup_read(pb, result, maxlen); - } else if (!strcmp(argv[0], "push_backup_write")) { - if (argc != 2 || sscanf(argv[1], "%llu:%llu", &val, &val2) != 2) - goto unlock; - ret = push_backup_write(pb, val, val2); + ret = push_backup_stop(pb, result, maxlen); } else if (!strcmp(argv[0], "push_backup_statistics")) { ret = push_backup_statistics(pb, result, maxlen); } else if (!strcmp(argv[0], "push_backup_get_fd")) { @@ -975,7 +936,7 @@ static loff_t pb_llseek_hole(struct dm_target *ti, loff_t offset, static struct target_type pb_target = { .name = "push_backup", - .version = {1, 2, 0}, + .version = {1, 3, 0}, .features = DM_TARGET_SINGLETON, .module = THIS_MODULE, .ctr = pb_ctr, diff --git a/include/uapi/linux/dm-push-backup.h b/include/uapi/linux/dm-push-backup.h index b43e2e55dc69..b8d336f9fcc2 100644 --- a/include/uapi/linux/dm-push-backup.h +++ b/include/uapi/linux/dm-push-backup.h @@ -30,9 +30,8 @@ * EBADMSG - internal inconsistency of the pending state. * * write(fd, &range, sizeof(range)): - * acknowledge that @range has been backed up; equivalent to the - * "push_backup_write clu:nr" message. Fails with E2BIG if @range is out - * of the device, ESTALE and ENODEV as read(), and EFAULT. + * acknowledge that @range has been backed up. Fails with E2BIG if @range + * is out of the device, ESTALE and ENODEV as read(), and EFAULT. */ #ifndef _UAPI_LINUX_DM_PUSH_BACKUP_H #define _UAPI_LINUX_DM_PUSH_BACKUP_H --- base-commit: aef96420256e57bf1291859a844800a462f2790e change-id: 20261126-push-backup-messages-dfb26a564ecc -- Best regards, Vasileios Almpanis Software Developer, Virtuozzo. _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel