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 BE22880E7E for ; Tue, 3 Nov 2026 10:12:56 +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 6A3ABgtf003951; Tue, 3 Nov 2026 13:11:43 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A3ABgtf003951 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="yDxxMVW+" Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6A3ABAoY003891 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 3 Nov 2026 13:11:11 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6A3ABAoY003891 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-48b0a199b20so3338433f8f.1 for ; Tue, 03 Nov 2026 02:11:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvByzrN8z2axhiOJDClU5WTUvDWMYXXFSQRHR4dZiOJJ2Nj1h0IzYTJrXdgC23n5BxWqhSz6cEA==@openvz.org X-Gm-Message-State: APuU4Z8p84n4vlr0sBXfg2RKI4GeUP3CVgIdJHwmxTMabGINDw/O98wl Ne3hWjAQxEYmuWYyobWwwE/QY0NgR12lRKCW/B6tKX3lOcS939VtPuI8G5J8Zl+ZCqXMXxP8wE1 Tm6LW5hCUoZE924EZKpxYl6Fr9FZLp82XTfHUy0tD3Wz/6HEWgtovlg== X-Gm-Gg: AYBFou2OGkl9pAwlfKBrhzFTDfRQ4+5LwOf08qxMI/ziVMs0rS9fXTvNXXOxPjjyojE XvLiwyj5voBsV+cIHFMUeJR7R6bqASoGNqMPCNuyvvdkIztz7qOJlZTaN4YZRoNR3HyR0pAZvJm zbZftdV/6SRchKKzuw4hixRMx9y+4LYqh2p97ofi/6zYnYfz4NB3usJ0eq75RBQyLceLulS71jJ WkgE+KklESTTDHfwNVS3s85GKuBupr0QEk9wmZoigxoVJiqfkyR3WMU426X8b+dHRWe4QbruUR+ F1AmPtDLSOADZIlEx2DdMwwr5lv/mNYBQx8XbEzhlMt6L+uT/GcU42ZJxRhVm7NJy6tpm0g9hlw Vm1eP2Tt3n54wFdYUwA== X-Received: by 2002:a05:6000:22c8:b0:48e:2c2f:59eb with SMTP id ffacd0b85a97d-48e6e303c74mr28380336f8f.12.1793700670398; Tue, 03 Nov 2026 02:11:10 -0800 (PST) X-Received: by 2002:a05:6000:22c8:b0:48e:2c2f:59eb with SMTP id ffacd0b85a97d-48e6e303c74mr28380273f8f.12.1793700669837; Tue, 03 Nov 2026 02:11:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793700669; cv=none; d=google.com; s=arc-20260327; b=NTfiqS9amNIAP0pD7AxeNKMUyKsFcbY2kGg4LzjQxyNYIb2Bb85CL1pJjYkhKoTLsh /W7QcYFNsyopVxAcHsKkShrTGPRdiI9RKTA2alCqdcDvfEubzy1HjK0S+ibIOVe90iNE lyhxSXHJ0JatTAletaLunQigRwzD7r80rNTYWBgFxTPZI3kj+PS8BRJuVSmBnq075EfQ PfjoJRe7Gmq40HbvfpRQ0T91NNC2rUYn6m4CVRfiPzdUTtCBqcpUAryEz7JVPiVgtfh1 6IsRwQl3+mkc+ZaTH5BciawUzyrEqbUGCC70xfx+72SH9SBh+6GB9xDuTDkoYLKE+Mdv g28g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=ft+SZIyD1CwsRPcN+OcvwW64cdtCofYuVHrREbgKywM=; fh=NNIHAR0oQq9xcHtG6fvuNrouibWQy9PtHjAIRR7/XzE=; b=fLRRNmlFki0ONlo5z9Wc8NLBdcMPZxJqf0wfa4R9wd99M+X9SBD6B3nQMPi2C3BKqd yb3dHMBT6BRq8Pp+vULFc7Scol1/6jfDVIalqQV1KjPJfHRdFRsB2VdcsQuYvS4j2HKX lIap6ufnWBujVqrIeXK5NmY7eKj0DmO+37LUXX4NOs5CL8fbPdR9LZYO8Voc2sxLjyWh X61z6+9St0OVq9k0173VZtMF7Tc7o99D4KV0LWDDaxdGJmGqJ57EzGsfoF/RiF8qhCRg 03DkIpvbe5VjY+ZdUnvRVSP/LTAiwK9gCTEOiQyPrZWmC5AiwziIvX/5Tpn2vPcAOf3d 0w0Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=yDxxMVW+; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@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 ffacd0b85a97d-48e71bcfc4fsi24097014f8f.411.2026.11.03.02.11.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2026 02:11:09 -0800 (PST) Received-SPF: pass (google.com: domain of khorenko@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=yDxxMVW+; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@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:Date:From:Subject:Content-Type: MIME-Version; bh=ft+SZIyD1CwsRPcN+OcvwW64cdtCofYuVHrREbgKywM=; b=yDxxMVW+r9yj XeWHd5nfrHEWcN5jJxtGNzmdnNvd6Cn0LXEGsqaDe4L23YiwTMp8pbjWbQM8q2WbOMZJVwc4qA7wQ FTogUGl5uNVd2ivrYhQjKD1yxotS3/OlbPkub227v7QzheppPFsSXhj/q7KVWfm4a9QyRlbua/TD3 QQwD7sxdZUwx2QmGHw2iBoJHzPCCQj4Aedxhzhtr98+l+dgNSTrXDoYGgZD1ecWPMlSh9UfJJlgfj roYhlV9qiHao/41RWBoIoV2kM595VCwwg6VjCCnNrGW51iGpZrVbVpsXzm0fJbCi6oLs9SOIPIHCF YxVOiWQIrj1B6F8tyPyOUw==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xOBQ2-00BKVK-1f; Tue, 03 Nov 2026 11:11:00 +0100 MIME-Version: 1.0 From: Konstantin Khorenko To: Andrey Zhadchenko In-Reply-To: <20261103080358.723186-7-andrey.zhadchenko@virtuozzo.com> References: <20261103080358.723186-1-andrey.zhadchenko@virtuozzo.com> <20261103080358.723186-7-andrey.zhadchenko@virtuozzo.com> Date: Tue, 03 Nov 2026 11:11:03 +0100 Message-Id: <179370066312.2382033.5229621205243216100.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3367; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=HsGIiUhvrm8EoGn/ExNf1LbH3y2Hj5KIIBZrOfs4mbo=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBq6bM68aQFIlEf8ROeYuxsES1OOmUyd9SiqI36K PBlUE/FwF2JAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCaumzOgAKCRBRlgpH+WFc KibuD/4/Deon7w0xxWH1XHyIR43fIovZMJP3sCBpamwiwZvW0Z652DiRhTgBslt03QAOKGKi5qA Mzd0AxvrzWGK0ar4s5SyxScgBCxwz102Yp1pu4vTMVDzirPGpaOS5cxC2vAE31MiVbHrrUzqOF+ pdjzBW0eYMcbxhrAazbZJ0J3LiAzZtX4Jzc0JRgCXBIT4m1bHPAPxcTl8ki5/ZWJqlTJrH+oN5T 5VS4/XTIKIpmhjmylGfGFBUFBC+EWF+yuanUaPbtfPy8PNrIyCfOMSSF/xJGys5qU9YDg2ZyVmN 1YY45xEKTHcyluNIP2s/kRlYgnYKueXEXdweOek60JSjmMpAC3sGzkliunBDcWThsdpnKcO4PIA m3e61SVQfrfTvBSvbXCvDNSQDB0suya6P2VpuwM9pEWEXi6oDbwZHuV8q5hh2+IFoYH+p031TeR m6FhSDuhCTWUjUADR7LhjDDXVJKIRs/cOGQz0IAd95C10P4WusfMEaPFBbKr63P5yBa2hSZw7Lv X3H3oFBKHODxl94sUXwuFTGtiUXgnyZjG5eoJGNZs/FYJU/mjekY9g/T1BoY7769qlEz67kild3 S7UW3JcL5yIse+ISBfm/s3Bb2RmAFrNgNFl2JDe1VtAC8+u3bLy5biImNiv6lqMzMlwwhXWP/JE 92zxWehn+RL9Nzg== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH hci-8.1 v4 6/6] drivers/md/push_backup: add event file descriptor interface 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 On 11/3/26 11:03, Andrey Zhadchenko wrote: > The legacy messages keep working unchanged for compatibility but we will > clean it up later. Hi Andrey, I found no locking or lifetime bug here: the kref, pb->destroyed and the reserve -> emit -> check -> install order in push_backup_get_fd() hold up. A few things to settle before the UAPI is fixed. The legacy path does change, for the better: pb_message() parsed u64 and passed it on as unsigned int, so "push_backup_write 4294967296:1" acked cluster 0 and now gets -E2BIG, and push_backup_read printed "%u" on devices with 2^32 or more clusters. Please say so instead of "unchanged", or move these into a separate fix of 62e07487348e. > Also destroy pbio object first before requeuing in resubmit_pbios(): > in-flight requests hold the target which we may have already stopped, > so dm_requeue_original_rq() may trigger .dtr and invalidate mempool. The requests pin the mapped device (dm_start_request() -> dm_get()), not the target. Only the fd write path needs this, as it holds no md reference. This could also be a small preparatory patch. > + ret = -ESTALE; > + if (!pb->map || !pb->alive) The fd is bound to the target, not to a backup session. After "push_backup_stop" and a new "push_backup_start" an old fd keeps working on the new session. A reader blocked across the stop can even miss -ESTALE: if start has set alive again before it re-checks pb_has_event(), it sleeps on. A leftover tool then acks ranges of the new backup, every ack clears map bits, and the new backup silently loses its point-in-time consistency. The legacy messages behave the same, so it is not a regression, but a new UAPI cannot be tightened later. Could the file record a session generation, bumped on start and stop, and return -ESTALE once it is over? If you keep it as is, please say in the header that the fd survives stop/start. > +static const struct file_operations pb_fops = { > + .owner = THIS_MODULE, > + .read = pb_fd_read, > + .write = pb_fd_write, > + .release = pb_fd_release, > +}; read() honours O_NONBLOCK, but without .poll the fd cannot go into epoll and poll() reports it always ready. pb->waitq and pb_has_event() are already there, so .poll is a few lines. On the header: userspace gets -1 and errno, not "-EAGAIN"; read() can also fail with EBADMSG, EFAULT and EINTR; the fd is O_CLOEXEC. The fd is installed before dm-ioctl copies the result out, so a failed copy-out leaves it behind, and "dmsetup message ... push_backup_get_fd" is of no use. One line on each would help tool authors. After pb_destroy() the struct may live on through an fd with ti, origin_dev, wq, pending_htable and pbio_pool dangling. Every fd path checks pb->destroyed first, so this is fine today; NULLing them would keep it so. > while ((pbio = list_first_entry_or_null(list, struct pb_bio, list)) != NULL) { > + struct request *rq = pbio->rq; > list_del_init(&pbio->list); checkpatch wants a blank line after the declaration. Commit message: "This way we will avoid aforementioned problems." can go. Please also mention the target version bump to 1.1.0. Is that what the tool checks to find the fd interface, or does it just try "push_backup_get_fd" and fall back on -ENOTSUPP? -- Konstantin Khorenko, Virtuozzo Linux Kernel Team _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel