From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 067878013F for ; Fri, 4 Sep 2026 09:07:32 +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 68496BRN031062; Fri, 4 Sep 2026 12:06:12 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68496BRN031062 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="W3TL914T" 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 68496A0Z031058 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Fri, 4 Sep 2026 12:06:10 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68496A0Z031058 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-472c330e555so363148f8f.1 for ; Fri, 04 Sep 2026 02:06:10 -0700 (PDT) X-Gm-Message-State: AFuF++nutK7bDeu7HBl3pLGL+QWQivmrKS9jqVK9poSg/Sy/XI33hqDf i92DjrxBDs/FB7x/EfxBCkwC1aSELA/pZrjFzWSePKgwhZRONJ43uTtuTJy3IIqfPVyO3K1OjZZ u7rS3FzmKAsyGzwqxWbkDdDwzR8CuZnTdQ+xIjlU+mcsufi45T68xIg== X-Gm-Gg: AYBFou0tOrsvfJyEOeSHEcQSymOxgr6+WUqjbNYIC9fxbsQly5b7u4z90eCTtpyKCNb YX4hP+aorj+LXhrWxq1v34M/hQNQUmzE89lAcMk6vbfsC/HgLryMMQVc6e73BDG1AuQ6pLEZP5t yTt9okGb0vuGhu+4YUxGPmj531xZ/+tWcxuDswXdRxwWyevD6WqQG6RjW1ilSC3PYiNSL9drHoY L8GjrnnLW24GkYOn2xlc8bVs/3o4rQh+M3y6OxLsI0nhqVkOSgSxY33ShBCx1m2ehTD0RZ+l6Yz VUKkicWZKB2xeYGGqaw0cEwarC7E5DjyiCfvz8auM1ho0eLXP9+vSbpB9SJlFB3syN+Wwd/lN3Z Zi5e3wKQv6Nvz45x+ X-Received: by 2002:a05:6000:490e:b0:485:82f9:44a4 with SMTP id ffacd0b85a97d-485872a010cmr7866917f8f.16.1788512769991; Fri, 04 Sep 2026 02:06:09 -0700 (PDT) X-Received: by 2002:a05:6000:490e:b0:485:82f9:44a4 with SMTP id ffacd0b85a97d-485872a010cmr7866862f8f.16.1788512769376; Fri, 04 Sep 2026 02:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1788512769; cv=none; d=google.com; s=arc-20260327; b=Si/ez72LAKW4uWgll32CyzA3an0xP5Z68e1UPA+9ZTQoJ/w/KkpB3+4y9yHfohlDlz LFQvArU/f1wcbkpFVVCVpTrqxGSTweWuTr1yuE/jZWzUAVd7JqrIYIlOeZ+BHvTGmHRu J2LUMvYX44arVtgBdfah9C7srFuYJRE153WbnIbr5qgmTKer8Inlcq48kEWjA1MFNEMc 7E6ys6KDaOY+MQfigRvRQWTgTM0g8MC+QQfeI+45PcJg+1fkLj+X8yLubyXAOPiGIRgl Gam2fCSW8WyONLfn4+IA3FbVK1OXaHDgGW/jzu1AmBVdw4pwEMr9rt7nuvJRpggF0SYa ggLg== 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=IlRO2439Jn4a9dE6w6GLFIbsvIREPnP7IaCbigpvNv4=; fh=IbaWj82zqOZm03F/eoPTlWBn4zwBRsoZlMDBqCRFIUM=; b=NyhBraqO3LNd+p4rBfLoLdasaYGJaZxFJgt+waqgZouKUTToUI0Gn33gfpG3nAdxml Fqlip5iIssOFCcBqMfgBEGj7H+I2dlTNZNaG0A6tTC1eSje5PYfTHzP3JJnK62ciMjeE S7Din2/AqiWme208AWFAGI3/HC+F2ZO2epBj04bbzzbHNV6aM9St1CJss4T9HPTuPlvI kX9qNAJhoLQ1x5qgmpIjgtOvz6Fihzet0/vTeqT52hFI9S6j83FPdoLQiWVJbTfuw3wo xPN5HJtccP6JHUuhzoDyEJwICD3CmN+u7mFDGdDkUg9LsRotjlIOqUBYT+jgiv5rjt9i NHCQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=W3TL914T; 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-485883c6e03si4457540f8f.154.2026.09.04.02.06.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2026 02:06:09 -0700 (PDT) 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=W3TL914T; 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=IlRO2439Jn4a9dE6w6GLFIbsvIREPnP7IaCbigpvNv4=; b=W3TL914TxJL/ 1Tvl4TNf+hUtDHCW9P7cCTiV+1oH5YxdzHGaVPPLf1TyxVurANhUFz21yMeis3R21FD96F/pxl4dU C3lKuSvVgOlckuIyC9EuWX2X2M15eKZQXQJv9ZgZ0YnYAX0/hNzLwG/H3tJ5PfWLiS4357kcn9dmW agy333DVJM/5jOZkvDFpzAvu/trjtQVYpJ9RBnjxNNuURCz99DgCzR/SRQaclNXdLZcLlul4SkIx/ ly/48wRAtIS095AIq4afIa/GWXYLLQYfT1BW9P0EKLtOFgmb761pnzOAYPeLQ/SvBi9QxwS7OmCyb 1eT5yTBRYDRe9aFS7PObig==; 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 1x2Ppg-00HJ5n-36; Fri, 04 Sep 2026 11:06:05 +0200 MIME-Version: 1.0 From: Konstantin Khorenko To: Liu Kui In-Reply-To: <20260904015755.23985-1-kui.liu@virtuozzo.com> References: <20260904015755.23985-1-kui.liu@virtuozzo.com> Date: Fri, 04 Sep 2026 11:06:00 +0200 Message-Id: <178851276075.1372856.4272514571977010402.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2325; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=pQzIKNBTzmV7Kc3Qm0KG9xkUUFGkhmTWe0QszeJAhgQ=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqmooAKsamNBMpdjJhPVQilkC0fOiV61VeCM3dl lzjGiVAt9eJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCapqKAAAKCRBRlgpH+WFc KhnOD/9fAX3pPN5/l+t82VU+CBcB3XU/aeFOUz/vN+IwjzOi0ZOTvfQgJbid5e0rS72AZzxb6r9 nIZZzIrGs5AM7IFRWEBxg9sslNm8kXmJTBOub+j/jaMpmpz2CIru5KFl+8TW+Arj/oF85Ge1SDP C+tsglem9aP5mx7b2u8XVtHlYx4w0jEQpGQzZTYV17MUNSSLlMzH8bjW0IEVtRlRCPsa1FNzmZf im4InHIUupQ9BwYgJMqjkOMatXmQ211l376iUfhLwN218L3npJMITT7WWFTXJFiRy05GWKK73Bz 6L0U276mUWkOKX3zsUaUrCE4VqwQJlGgnsF3b6JtbJmO9kLvxn6ym1uFD9T01+Kt/oJtAupibyu U3HXydQff3RAyZ0jimG/M3JOknp6RHcE33PiSsGJ3cgiOyMNng29DeIkH3f5wEG71aAhsq01tVR oNtsGhuFpChOp1BDhsxIRg/EY1LMcgSDnXinepGh7fCYphoIeYbSd2mZzKDlpdSrrJ58q7i/Iyj 8lFxKuXwxeLdLHcMtVyz1SU+8RMnhY3LTdgFF3IdyKorcpaM46mInSYQ3gaYOKAu3zrwps0NF1l OYtpXUR3/KJmGmpDh3gvkoqVVgc7jV35k2H6N1LAGIEdbSprSqNcRoGEoFXvu+cvIVzm9+R61Mn 86xJ92/Uw/iNQ/g== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: azaitsev@virtuozzo.com, devel@openvz.org Subject: Re: [Devel] [PATCH VZ10 v2] fs/fuse kio: track pending kRPC connect via state machine, not a pointer 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 > Rework the previous fix ("fs/fuse kio: fix kRPC connect issues") to not > require the new struct pcs_krpc member "connect_req", so the fix can be > shipped as a livepatch: struct pcs_krpc objects are long-lived, and a > patched kernel would dereference the new member on objects allocated > before the livepatch was loaded, reading unallocated slab space. > > Both things connect_req was tracking are already derivable from the > existing state machine once PCS_KRPC_STATE_CONNECT is made to mean > exactly "a connect req is in flight": > > - krpc_connect_done() settles a failed connect back to UNCONN instead > of leaving the state in CONNECT forever; > > - pcs_krpc_abort() no longer resets CONNECT to UNCONN: the req is > still in flight, and only its completion settles the state. It > advances gen instead, disowning the pending req: when the req > completes, krpc_connect_done() settles the state to UNCONN without > committing the dead session, even if the late connect succeeded; > > - pcs_krpc_connect() proceeds only from UNCONN or ABORTED, refusing > new connects (-EPERM) while a req is in flight - at most one connect > req exists at a time, same as with the connect_req check; > > - pcs_krpc_poll() reports EPOLLERR on UNCONN: poll bails out earlier > unless ctx->gen == krpc->gen, and the current session can only be in > UNCONN if its connect failed, which is what the (CONNECT && !connect_req) > test used to detect. - pcs_krpc_poll() reports EPOLLERR on UNCONN, and the gen check moves under krpc->lock into the same condition: with ctx->gen == krpc->gen the current session can only be in UNCONN if its connect failed, which is what the (CONNECT && !connect_req) test used to detect. > Within CONNECT the pending req carries the current gen unless the > session was aborted, so a gen mismatch in krpc_connect_done() reliably > identifies a disowned req. > Fixes: 7ae23fa1c145e ("fs/fuse kio: fix kRPC connect issues") Feature: fuse: kRPC - single RPC for kernel and userspace > https://virtuozzo.atlassian.net/browse/VSTOR-135626 > > Signed-off-by: Liu Kui Reviewed-by: Konstantin Khorenko -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel