From nobody Thu Dec 26 20:46:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1732822716; cv=none; d=zohomail.com; s=zohoarc; b=lxD+6WzpLqLrDYu5+iozRLMjV2aiKq8rl9JpRGuWrBOZo2ZHgFlhYIT3J4V9O98sC5FtnA4bxCVSFp8liCRHdvppzAl8Wmiq5bq+rMEfHOM7yl4+g4dlCZslvSlZUTOYAoZXJsL/TQXp+//7ro6FnHobbJKCe+u8L29hvK9+KtI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732822716; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WpNnfdMSmJ9VqxtVLFQyTz3SmuQbK7pH3Ndcci69wQ8=; b=M7RfTsBjeVI7CYKRYrndE2sR7uWFrndqzPM0VJAXknE/drtmiGyVvuK/M0QFRSUjSN4XwohUJ1txNPSQ0N0hb4NdWXk1SdEhxE7lLM46gqKkqmeLv/KEp94CzpLzS/7AYg7YUL+Fnjmhm3SuOHxarNCkayC6osqhTNgDLUaSK10= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732822716885135.9121805494674; Thu, 28 Nov 2024 11:38:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGkL9-00061t-5P; Thu, 28 Nov 2024 14:38:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGkL7-00061J-Ga; Thu, 28 Nov 2024 14:38:13 -0500 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGkL6-0001jj-2R; Thu, 28 Nov 2024 14:38:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=WpNnfdMSmJ9VqxtVLFQyTz3SmuQbK7pH3Ndcci69wQ8=; b=Puspp OSMc4T3ovGoUq6/SNFfkbDTtXdwbzJGMvW6NVI2guEmwpcYQuArs+hfvsk//vCJR3NcRvpOKSTI6V PPuPtDEg8EjO5TPZx/5QYjSYIG6PX2Txqda5wZK9qzOtXV/C1YHJqZBTzMSpC+Mx+0g+Nkz5oXjBk MivrIS0poeVr3ydStFZjqhcwxH0dSy1EUmW1o+mfYtrikgzZytx0M8JnDE+gwbutSP4ojiEJD9e8c lWIvbV2yKWy0FepHd/spujSuvLDqrS7aihdsGZ+Yw49ZkJmi4itaVAC+usF5xP881Pnydu7PGUwbe LBwnxW2c2lZN3gSXVkwr0UMYPzVtyB/Y2lqqjBaYGju29SefG/FYzXquU6AEAb3OP1InB+DqLV0KP hIWOcjNF2ec7bHLVvrq+ovkbuBquq55c2jHzAlEz8klzywXLMgV08ZHdGI/k0HEG8Pdbnm92dPZ7n zP4O+asNR1nlVpMcqaJdvHdnQb/VyHAv8t+2pqruTndmElHpQ7o/b+ObL0QwQT6vjy/CQpSwP1Fgq AsS3tnvOUJfUWVYxB1UgeBxO+MIcU3gRvkhhsDjbYIDgjYC/9CDN5dCAIKxTL07blhq3BBQIXEofv BQuI5dDqBvPtFo2AdRQL1nMn6qWmxeg3cbqJHAY48meNMRwvb8KmuuxxGos2LQ=; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Thu, 28 Nov 2024 19:53:58 +0100 Subject: [PULL for-9.2 1/7] 9pfs: cleanup V9fsFidState To: qemu-devel@nongnu.org, Peter Maydell Cc: qemu-stable@nongnu.org, Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=5.189.157.229; envelope-from=f2db23ede5b3015330c2314f796dd694f35c7508@kylie.crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1732822718064019100 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Drop V9fsFidState's 'next' member, which is no longer used since: f5265c8f917e ('9pfs: use GHashTable for fid table') Fixes: f5265c8f917e ('9pfs: use GHashTable for fid table') Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: --- hw/9pfs/9p.h | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index a6f59abccb..5e041e1f60 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -280,7 +280,6 @@ struct V9fsFidState { uid_t uid; int ref; bool clunked; - QSIMPLEQ_ENTRY(V9fsFidState) next; QSLIST_ENTRY(V9fsFidState) reclaim_next; }; =20 --=20 2.30.2 From nobody Thu Dec 26 20:46:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1732822787; cv=none; d=zohomail.com; s=zohoarc; b=A8Bakuh5IYfVqxJxcUWDmAeQGx6cUUXRjHJRhTkW/+SnRWr6UihVui1ssHWwvkgWRQ/O06sSw+J6QAI9d/yAUxkDVLXme52OISswn0+lZ0k0s8Gtx3f67/t/m8OxdoOBAHoEzTZHLyNZfrk0+eZaebj/ZXmDibX9FtOTuvg5iXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732822787; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pI02vUEzLaL6hvgao20/kKv0iB3ubx0RrXQPy8qFfY4=; b=Ut1nbitCgVTU0qkPABw81i7y5CDTpcpCnkx2dyl/brN2WikJuVujdos9Xtj3GrMMbtnWhb7c5XL4l34B1DrbOIApUexLHUjb5JYyFKOl8Vq3r6114o4GemoCSYVdl1/lUcFDjH+MyuzwhCpz57Vq9ajBYeLusGN6oj9c2kdPs5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732822787282885.9719556459597; Thu, 28 Nov 2024 11:39:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGkL0-0005yQ-Qg; Thu, 28 Nov 2024 14:38:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <462db8fb1d405391b83a0d3099fdb9bfb85c2d92@kylie.crudebyte.com>) id 1tGkKy-0005qT-1R; Thu, 28 Nov 2024 14:38:04 -0500 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <462db8fb1d405391b83a0d3099fdb9bfb85c2d92@kylie.crudebyte.com>) id 1tGkKw-0001ft-Il; Thu, 28 Nov 2024 14:38:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=pI02vUEzLaL6hvgao20/kKv0iB3ubx0RrXQPy8qFfY4=; b=VCkWL qsn/H3aD2SJJeGxqDzkuzCq6n/CZRPvFPAQ+FEG5z6gIrEw2yJwG9mpVxRRNOOeFUmqOzx1A8vNtZ D5VoUvt8emUDFh2AZW3CcUukImk9ukl9Lypth2TyN1qzo/zaRx355yiaI317ht6wTE2xI93qNqy9m iN148WX6QnUbgEtMyaTjitbuC02UFju+nUgghOSvnYZj81mo4fFKbUJspxi8umI0L+mc/mQjdGaG9 unXaU4VavSDo1e/p0fXBrHHMJ/o3uHifU0yiV7RHOqfzTM+4FGWN5vuqMAbXJKBlCEzVCdlNT5H5n InsODab0xp6i0IoL9bSzACYG3XFL6d40KBaN0AV9ouGnNza2EC9CDwXVBmlgVQ5IrHwy8WJBJ/GfX xOXrNt5aVuXyXVreUChgi5v2gwS7j4hAklqEofLc9KfafaIUbJvT9g+yqt9wg0IKmi6C5Hc5VqdGe CfLVPoN0sGPTml6+l3JTuiwn2QRXCI+lWlV2UrxUjXWg4Sk8YsThqTVAj5oV9f6lZPrNfgfDcOHb2 1XixKVXI+Ba2jaWB2RhD5jSx14txVnILyEhCqZG1mgVgYipRanCFtCNN0jWhSvbGYlaPA4Cb1ECtW wiDUChkCtgjkoJk/g25HrPRHVErRVMXjxTd1V2n/uSx5SQGn5l6sz+yOGQuJfY=; Message-Id: <462db8fb1d405391b83a0d3099fdb9bfb85c2d92.1732820037.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Thu, 28 Nov 2024 19:53:58 +0100 Subject: [PULL for-9.2 2/7] tests/9p: add 'use-after-unlink' test To: qemu-devel@nongnu.org, Peter Maydell Cc: qemu-stable@nongnu.org, Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=5.189.157.229; envelope-from=462db8fb1d405391b83a0d3099fdb9bfb85c2d92@kylie.crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1732822788020019100 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" After removing a file from the file system, we should still be able to work with the file if we already had it open before removal. As a first step we verify that it is possible to write to an unlinked file, as this is what already works. This test is extended later on after having fixed other use cases after unlink that are not working yet. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <3d6449d4df25bcdd3e807eff169f46f1385e5257.1732465720.git.qemu_o= ss@crudebyte.com> --- tests/qtest/virtio-9p-test.c | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index 3c8cd235cf..f6d7400a87 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -693,6 +693,45 @@ static void fs_unlinkat_hardlink(void *obj, void *data, g_assert(stat(real_file, &st_real) =3D=3D 0); } =20 +static void fs_use_after_unlink(void *obj, void *data, + QGuestAllocator *t_alloc) +{ + QVirtio9P *v9p =3D obj; + v9fs_set_allocator(t_alloc); + static const uint32_t write_count =3D P9_MAX_SIZE / 2; + g_autofree char *real_file =3D virtio_9p_test_path("09/doa_file"); + g_autofree char *buf =3D g_malloc0(write_count); + struct stat st_file; + uint32_t fid_file; + uint32_t count; + + tattach({ .client =3D v9p }); + + /* create a file "09/doa_file" and make sure it exists and is regular = */ + tmkdir({ .client =3D v9p, .atPath =3D "/", .name =3D "09" }); + tlcreate({ .client =3D v9p, .atPath =3D "09", .name =3D "doa_file" }); + g_assert(stat(real_file, &st_file) =3D=3D 0); + g_assert((st_file.st_mode & S_IFMT) =3D=3D S_IFREG); + + /* request a FID for that regular file that we can work with next */ + fid_file =3D twalk({ + .client =3D v9p, .fid =3D 0, .path =3D "09/doa_file" + }).newfid; + g_assert(fid_file !=3D 0); + + /* now first open the file in write mode before ... */ + tlopen({ .client =3D v9p, .fid =3D fid_file, .flags =3D O_WRONLY }); + /* ... removing the file from file system */ + tunlinkat({ .client =3D v9p, .atPath =3D "09", .name =3D "doa_file" }); + + /* file is removed, but we still have it open, so this should succeed = */ + count =3D twrite({ + .client =3D v9p, .fid =3D fid_file, .offset =3D 0, .count =3D writ= e_count, + .data =3D buf + }).count; + g_assert_cmpint(count, =3D=3D, write_count); +} + static void cleanup_9p_local_driver(void *data) { /* remove previously created test dir when test is completed */ @@ -758,6 +797,8 @@ static void register_virtio_9p_test(void) qos_add_test("local/hardlink_file", "virtio-9p", fs_hardlink_file, &op= ts); qos_add_test("local/unlinkat_hardlink", "virtio-9p", fs_unlinkat_hardl= ink, &opts); + qos_add_test("local/use_after_unlink", "virtio-9p", fs_use_after_unlin= k, + &opts); } =20 libqos_init(register_virtio_9p_test); --=20 2.30.2 From nobody Thu Dec 26 20:46:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1732822770; cv=none; d=zohomail.com; s=zohoarc; b=F5YvYlum5h+JBRYknpE4QXgBNL+NNzBsqN4yTU3bPj9QCM2BsP1GSFwetzJtv4j5DQMGTQg1TuO0FxzyZoSPHinkmqO7vLEcLxElPkROV5o/bcpEXyYfqUakAY2k3ph1VseNTjKL3ykLFgEjQ1g+xl8AWtJ/N8WyOaCjO6YeIfw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732822770; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Qk5/KF/1vF+ZSw5b8p5vFLsVZz9aE1CGi3a3hyOPSlM=; b=IpQb9Y0GiH5+sMbUsfXFk4L7j22Qv+9ukWGJtGgXqCjLtUK+Q/SdvBXknmzD+Nd8xPszKufu8nWOa4LUArG80qdijF51GDAjQt8IBPVQnM/AInPHkaXBHQbkz9osk27MGMxRPDsu9rfrPJT13bezC6x844viBUasFknjH9ye5CQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732822770038368.42221114314714; Thu, 28 Nov 2024 11:39:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGkL6-00060a-Ib; Thu, 28 Nov 2024 14:38:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGkL4-000609-F0; Thu, 28 Nov 2024 14:38:10 -0500 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGkL3-0001i5-4a; Thu, 28 Nov 2024 14:38:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=Qk5/KF/1vF+ZSw5b8p5vFLsVZz9aE1CGi3a3hyOPSlM=; b=d5Nym Df9Qb+BBRe7hgedaCSn2W1Hn8fSdtkCjYYjUak9RMvmsqfoXUo2mWMj6V2cc7ctIn4/HJkcszVd/k HLUP6YduSTFeQGJnxxv1NWcKfYujqfUgNMVH67lYgP/YmMSMshEekwT6srq3SwTnVCB0dWygDfYPl qiRY9nBEqdo+oENR7wfTr29a1FdaGSXhIAxXfqvJqawu4U97qh55Wb2L9ZX6aVg0U7jit/J+T2aNR yRaSUVt3H6dO8T7fWt0eZpC/rohXn7HUIgfj6ZL3ZCpPVPJivxtQXwhpTPAIVyKr3I79zBzvmFU4U s3RwI16eiGNBKBP/Ji7adHpJItULe+lvIRT1ckCTaIVCI2AjDpJTnJrGOulR3LQy3e2bxYkQikWe2 AlZ4YVV5ZVgSDGYwAktGKysxRqaj+HOlyaZjzIVH92fLXCzatOvRx0AbC59l57wq5YcUmAomhP04g ZYID4xxwd7tGxzCVIhz2LmnSPXEVZ2kXBVjo7Qq1EAE4FYgDogr94ReLbhso+sIZNtwrOoK8h51D8 oxH8nVIr8TD6LjXK9WWY4PY1s41QBeH0nvIUiQ6Prwd8QZj9ryYORF/mvDsFYvQvCDUc0RiUKWxjw ZKsjgE86G5GGoOG1WnuNDhsHHiCsjLSS9T+g+HGW98gR9El3LhHZgaWjHk09VE=; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Thu, 28 Nov 2024 19:53:58 +0100 Subject: [PULL for-9.2 3/7] tests/9p: fix Rreaddir response name To: qemu-devel@nongnu.org, Peter Maydell Cc: qemu-stable@nongnu.org, Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=5.189.157.229; envelope-from=abf0f092c1dd33b9ffa986c6924addc0a9c1d0b8@kylie.crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1732822771985019100 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" All 9p response types are prefixed with an "R", therefore fix "READDIR" -> "RREADDIR" in function rmessage_name(). Fixes: 4829469fd9ff ("tests/virtio-9p: added readdir test") Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: --- tests/qtest/libqos/virtio-9p-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/libqos/virtio-9p-client.c b/tests/qtest/libqos/vir= tio-9p-client.c index b8adc8d4b9..c61632fcd3 100644 --- a/tests/qtest/libqos/virtio-9p-client.c +++ b/tests/qtest/libqos/virtio-9p-client.c @@ -238,7 +238,7 @@ static const char *rmessage_name(uint8_t id) id =3D=3D P9_RLINK ? "RLINK" : id =3D=3D P9_RUNLINKAT ? "RUNLINKAT" : id =3D=3D P9_RFLUSH ? "RFLUSH" : - id =3D=3D P9_RREADDIR ? "READDIR" : + id =3D=3D P9_RREADDIR ? "RREADDIR" : ""; } =20 --=20 2.30.2 From nobody Thu Dec 26 20:46:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1732822716; cv=none; d=zohomail.com; s=zohoarc; b=U27rRjC8PPAbNuI+keJK0QlSyivqUA3GyoSvKJ618X7RwRwBOXvooRMu2/+VBf/2qhiMKITr/dzWqLcUzt7h5mWHFSSuPBwtr5cnwgqLwEhS+py5RDH4UurVRWwiHDtW9302WtsnD0gmcakuXzfHsOxXdG6NzsIqHlHtAuwsKyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732822716; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=70oy+zIhcKqU3nbM95roDK6p30oLfuPq18fgj+sPGlc=; b=WLQu2rgjY8cWLODhzSeu4zBd0yE+1p8OrnuYcesS9/GNvAYRFBMJkqlEaQtIJqgMBXziD4urMZ9PN1xEh8IC6cmFGwGcnExmhRyQH66Vo19xAA8h4OAaPVjrGSJyFM/DgKhv9O8Tfr+RCd28JSmR7trYcViCLJ9zEPY1IfP5pLc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732822716429536.1458487592917; Thu, 28 Nov 2024 11:38:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGkKx-0005pE-PS; Thu, 28 Nov 2024 14:38:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <4ec984965079b51a9afce339af75edea6de973a2@kylie.crudebyte.com>) id 1tGkKm-0005jz-PP; Thu, 28 Nov 2024 14:37:54 -0500 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <4ec984965079b51a9afce339af75edea6de973a2@kylie.crudebyte.com>) id 1tGkKl-0001VB-0V; Thu, 28 Nov 2024 14:37:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=70oy+zIhcKqU3nbM95roDK6p30oLfuPq18fgj+sPGlc=; b=nMj0Z HxYrcgTBnv5/lwX0zcTNSbYYyDyk/SKyJ9hEMfosmWMbwk1TDmqD4wI4pYMCmoR3AoeEXNJ33Hz// wbPMfdBLIuTJlu84IHoHSLXEgLwH296+6AHRDf0hOLBNk554P5deAif0jKU4je/JZYNM+ft/N/b16 E/Hq4O6OrgTpvtQPd8uQjmd+etOYCXHb3W2tsZMFooRKU/3vepZ81jDTO2fOF/8vO7Aue9TztQ6UN I8SnX7iTVqqqZZCmtO8N88yV/zuanmo8oE8l+JLRUmMRxlVA6uun4GusbnWTIXFID5U7d89qzJUV+ hChjyT1xvE+aKW/4iUS5CSJHbCY1ID/dy3xd/cwLcxvbCTksWSwVgRKKqOgUQYyDkbeJNhsTzRkjw I6+L8Ebl0TpOFktMF1FEc1CXyISezh8llbtZl2OJXWJ9WgjEW0xze6VEYUqVFmXggNdlg6lYyj7PP X6/YNznwsOBInSaxkdsk3Q+ETAgzCDJ18w+TmL9fg14tUX70raWEWDPFuTDaU9/fzk9x90Tz+4ucQ LNWAnP1HQcMYXe/4zxcAua0Eb1lAPkEWUuy+b2StpWiJ+fGSDjnZ+0v3agI5CZAdrXdWmhNn8krfo AdnbR5UIKSSlhdL5jhlyS5i4ptaRr6C2EJmevKGpxVOiYMoprUGR7QBJ13eFrA=; Message-Id: <4ec984965079b51a9afce339af75edea6de973a2.1732820037.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Thu, 28 Nov 2024 19:53:58 +0100 Subject: [PULL for-9.2 4/7] tests/9p: add missing Rgetattr response name To: qemu-devel@nongnu.org, Peter Maydell Cc: qemu-stable@nongnu.org, Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=5.189.157.229; envelope-from=4ec984965079b51a9afce339af75edea6de973a2@kylie.crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1732822718071019100 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 'Tgetattr' 9p request and its 'Rgetattr' response types are already used by test client, however this response type is yet missing in function rmessage_name(), so add it. Fixes: a6821b828404 ("tests/9pfs: compare QIDs in fs_walk_none() test") Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: --- tests/qtest/libqos/virtio-9p-client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/libqos/virtio-9p-client.c b/tests/qtest/libqos/vir= tio-9p-client.c index c61632fcd3..98b77db51d 100644 --- a/tests/qtest/libqos/virtio-9p-client.c +++ b/tests/qtest/libqos/virtio-9p-client.c @@ -235,6 +235,7 @@ static const char *rmessage_name(uint8_t id) id =3D=3D P9_RMKDIR ? "RMKDIR" : id =3D=3D P9_RLCREATE ? "RLCREATE" : id =3D=3D P9_RSYMLINK ? "RSYMLINK" : + id =3D=3D P9_RGETATTR ? "RGETATTR" : id =3D=3D P9_RLINK ? "RLINK" : id =3D=3D P9_RUNLINKAT ? "RUNLINKAT" : id =3D=3D P9_RFLUSH ? "RFLUSH" : --=20 2.30.2 From nobody Thu Dec 26 20:46:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1732822770; cv=none; d=zohomail.com; s=zohoarc; b=canio5KkUNA99Uidw4PFrjPWidH6FRdSJxdVOlGZQHUkxzP+U1JHLI6iVJAyaV6bV3hyqME859fDwd70E5eiXM9Wjr2p/FB32Jga4WkYuROpKH5ci2foSyA/XtFx2doJI7CBEh8NmdErcdDTlEBn/jFsTrmAsoVideQNW7md4xE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732822770; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yu2+fuCqlPpIhciUDx6LHQqmVm2hltzj+n6lloV1XYU=; b=iJs1IlgxCKU0cl0vv8ykbCwsz6IxrYxMcB6JLq1VReNMffaPTRc5+Ra4V5Wj14fjA4r7012kOxnlYpi31A/E4tkFgij6jDXjpEO/yV9P4GDNzc5NI5mRT6m8C/9pnIbTSo8sq+9W5Ub2/IJ+e7MXmzQKl9LP3K1yj133Uwg+s2w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732822770082202.30908000906254; Thu, 28 Nov 2024 11:39:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGkLD-00063Z-Aa; Thu, 28 Nov 2024 14:38:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3bc4db44430f53387d17145bb52b330a830a03fe@kylie.crudebyte.com>) id 1tGkLB-00062q-FI; Thu, 28 Nov 2024 14:38:17 -0500 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3bc4db44430f53387d17145bb52b330a830a03fe@kylie.crudebyte.com>) id 1tGkL9-0001kw-7m; Thu, 28 Nov 2024 14:38:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=yu2+fuCqlPpIhciUDx6LHQqmVm2hltzj+n6lloV1XYU=; b=fSzIY /KyiHI7rv04BqOMYeK0BGdgiAKwOpOmGz9yPEHMDVkGoU4NByf7u30NNmsAO1BC5X5UshHQElfOKy 33NPeubBG5MBhNC76u3Gh/lvvTIVdl8J2VMerVSeZT0Slunld5Elo0YDpogYv34g6svsdebZ1xGGM xFhSBZXOOChQMZAn1QVHJZJKsMX9Z/dlGNpyJa/XyoJ1d/63hbNmHBPtuUI7ogUAvS8b0Teli2mNr 4J9/oB5f5ZxrV6YVTsdpAZ2gmnQ3qK+rf1P49b1WEiW64QUkQL49AYjgqBod1OHCpZYIcXgHWdU5Z rV26EbRK1SdK1UWg/OpYraDZPRUJdG5nzYxa3HpjUoLO9nc75OTtdTBMzaBQLWsrRNDoPqW/b618C IVD1Xt+3syDQShf1dkqkp/0vgOH+/+Mv5owV0Ufj+Wez0jfLIkT8ef8jXZGFyq/YwtzNx+fra+ZIc KFDEalZbFAJ+roskpt3abjsRnIh9SVVrBuOWLvSXfgACg8WHjteZt6GYwIkBUgY7FD1vA3XdV6CB9 ZZAXUlryxwvT3NH7kpIhf/tgfJl0CajGPT86blmV3cAfmoqGXVhr7+5Md70q1l4gc3m3hDxuSOxwk QhK6Auy2RP5F8Sr5BTakJJLDj4oTLBTP/0hr3oUZeeplPySW3kbRaTeDUNDfsM=; Message-Id: <3bc4db44430f53387d17145bb52b330a830a03fe.1732820037.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Thu, 28 Nov 2024 19:53:58 +0100 Subject: [PULL for-9.2 5/7] 9pfs: remove obsolete comment in v9fs_getattr() To: qemu-devel@nongnu.org, Peter Maydell Cc: qemu-stable@nongnu.org, Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=5.189.157.229; envelope-from=3bc4db44430f53387d17145bb52b330a830a03fe@kylie.crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1732822771972019100 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The comment claims that we'd only support basic Tgetattr fields. This is no longer true, so remove this comment. Fixes: e06a765efbe3 ("hw/9pfs: Add st_gen support in getattr reply") Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: --- hw/9pfs/9p.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 9a291d1b51..851e36b9a1 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1596,10 +1596,6 @@ static void coroutine_fn v9fs_getattr(void *opaque) retval =3D -ENOENT; goto out_nofid; } - /* - * Currently we only support BASIC fields in stat, so there is no - * need to look at request_mask. - */ retval =3D v9fs_co_lstat(pdu, &fidp->path, &stbuf); if (retval < 0) { goto out; --=20 2.30.2 From nobody Thu Dec 26 20:46:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1732822718; cv=none; d=zohomail.com; s=zohoarc; b=Ej3yXDvYwH3Lia1xtqg5rCKIFcoZq8dzXYm2by3WJ1AhQe5rz6l9GwgNAVlofLKiokbmlmvaeGIXREmNdGHuGcwlqo+BaoirB/X0m98jPOEELa52nIzRm2BNfVQAWtwyROXuG+RJu3tQV/DbhK2ssdveIOFIUIETkxR5PSz1+Os= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732822718; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sZ1E9BcYHFsRPyZxFsRdJMwSjmBFK1SLraoUCBW0/70=; b=krCHxDzvqpmpYggPXvw95X40Ojz105G7klh2dzkNjxnRgKrLVA7c3s+6fx3w0ao7hYEKhUYO6//cSgGXiTUwuEAHXGxBc7IMNEIabbcXmXT6C8gC2SX7I8rp3l5JMTJne1UsvN5LnefhSEHq0owThDcY0MvXCViS75cAZbs6Oyg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732822718003148.5239856695714; Thu, 28 Nov 2024 11:38:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGkKx-0005pU-Qb; Thu, 28 Nov 2024 14:38:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGkKq-0005nh-Ii; Thu, 28 Nov 2024 14:37:57 -0500 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGkKp-0001ai-0Y; Thu, 28 Nov 2024 14:37:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=sZ1E9BcYHFsRPyZxFsRdJMwSjmBFK1SLraoUCBW0/70=; b=ZhMPu j39Ti84RLdDnZat4MKffb/WE/Bq3mYl0pKgav84zVbbWbQ0YobugTZ2sURuvtA42LCbVjU8r2rzLr l/+GT2HOtj9vyiasj4xGmlkr70nlRW25AsHo8X9g3npfcV0HJZhdZpkzNWU8AVIb0cGWUxZW6Ujgb 524Ts9YGl9uhQD7ZX+2LcWHkkFhrdmcl4b5DtjjISff5w5gGMspS4T14cWPDl8ApKpI7DREOqGfsa 2e4szqcS4FgQthRDFU17yLw2iQSBT1M1SAlxBH5nZrGCYAUoptzlS4himyfWa5ut25IOEbT9sTV8e IixA1MbTsMyCviABXd/ySR9zJxUkp5Y0Ll7Q1pR9AJ9Gp4pi73xXiXP3b5GoMummvh3EZ9Dmc5KHb MUhprQG0/mVOUvRei0wB40ALcXCzCjys2inIy8THYc+bAqqBKxy1f9JxP2dXb68/dk5kawS07nidS as+Lbw2zTg490b7Poswf7IUxwUKslCa4XQABX9vTmrEIh8xxbnBEZ+FK4f9qSCJ4FRbVW+Epq/cFj D2Dc33uM6ZqSD55DsgVxtujzsIBhp5f5PeZok9JEUO0bKF8BZC2oosnkbtNdjHByeuJxqvhNGMgpv IIlZxj5IO2Kc40bVxfnzU48qI0IB2jfZQ6qssFDm7kEdjen5aBikNIO6MG4rro=; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Thu, 28 Nov 2024 19:53:58 +0100 Subject: [PULL for-9.2 6/7] 9pfs: fix 'Tgetattr' after unlink To: qemu-devel@nongnu.org, Peter Maydell Cc: qemu-stable@nongnu.org, Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=5.189.157.229; envelope-from=c81e7219e0736f80bfd3553676a19e2992cff41d@kylie.crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1732822719704019100 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With a valid file ID (FID) of an open file, it should be possible to send a 'Tgettattr' 9p request and successfully receive a 'Rgetattr' response, even if the file has been removed in the meantime. Currently this would fail with ENOENT. I.e. this fixes the following misbehaviour with a 9p Linux client: open("/home/tst/filename", O_RDWR|O_CREAT|O_EXCL, 0600) =3D 3 unlink("/home/tst/filename") =3D 0 fstat(3, 0x23aa1a8) =3D -1 ENOENT (No such file or directory) Expected results: open("/home/tst/filename", O_RDWR|O_CREAT|O_EXCL, 0600) =3D 3 unlink("/home/tst/filename") =3D 0 fstat(3, {st_mode=3DS_IFREG|0600, st_size=3D0, ...}) =3D 0 This is because 9p server is always using a path name based lstat() call which fails as soon as the file got removed. So to fix this, use fstat() whenever we have an open file descriptor already. Fixes: 00ede4c2529b ("virtio-9p: getattr server implementation...") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/103 Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <4c41ad47f449a5cc8bfa9285743e029080d5f324.1732465720.git.qemu_o= ss@crudebyte.com> --- hw/9pfs/9p.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 851e36b9a1..578517739a 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1596,7 +1596,13 @@ static void coroutine_fn v9fs_getattr(void *opaque) retval =3D -ENOENT; goto out_nofid; } - retval =3D v9fs_co_lstat(pdu, &fidp->path, &stbuf); + if ((fidp->fid_type =3D=3D P9_FID_FILE && fidp->fs.fd !=3D -1) || + (fidp->fid_type =3D=3D P9_FID_DIR && fidp->fs.dir.stream)) + { + retval =3D v9fs_co_fstat(pdu, fidp, &stbuf); + } else { + retval =3D v9fs_co_lstat(pdu, &fidp->path, &stbuf); + } if (retval < 0) { goto out; } --=20 2.30.2 From nobody Thu Dec 26 20:46:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1732822763; cv=none; d=zohomail.com; s=zohoarc; b=Nr6cSPnQsjJ7KUvccuwpcVswUdOQgXWNikPAiYPPInLB6YS/ksj3OiKN+eJdTZUXD0rlEIyCIVna+qiGqrrXyd5a4SWgTD0NB2Jki58yaFbg9CC1ZVum39Va8fQbZ84zXfC6qU0PuBRgeVZBUrDY+T6sc7K+9EJD4y7q91/+K9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732822763; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4cxulYeO4NhY3t6U7QERTjOlXT5wKxyH+m3yclIV2gg=; b=VPlt1FIJWawWzRgPeMc5rFy9Zrq38BsqCqAPvA9bQvtJe2YY5VGXce3I94nFRpgcHd61WSkc1llHj0huRT2a8N/tp6XTjQkLbmZLZ/4gwdA71e85gYbOrscNKh2hR4gx5/oUtj+7pQEHPNvyyfDq25lxwTGYEG9W55T+7eLawI8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732822763573160.44310052349363; Thu, 28 Nov 2024 11:39:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGkL0-0005vy-6W; Thu, 28 Nov 2024 14:38:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGkKu-0005pF-Vh; Thu, 28 Nov 2024 14:38:01 -0500 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGkKt-0001e6-6v; Thu, 28 Nov 2024 14:38:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=4cxulYeO4NhY3t6U7QERTjOlXT5wKxyH+m3yclIV2gg=; b=UpGd5 9j2M+YyfJKOOJz4NDFXchilnA61SvNOkJ+np2oYtTv/pwemf4yuosqcnk/A078pC2k7ky6wGX/UD/ jUgpUealMDkdLIOz3GWiniuAyEYGTiXwDNH/uIvaocqqZjzg3qmjLMofgMYoJFBQwSAWyzenlpaqg 1kg0np98lJ4xsgKJadnKI/LL2d8xTnu1zP1+k4O+gTAjubKuqDHG6ZqaS22dZc8kHO9DYlICANtEP JZiwVHKtax3bXOLerHhL/4MJtE7PLR7G64aGPUif5trx6d0/Y8eyAtihl83E+CPf0LaHhS115l4Ix b4U8Qg991lAfv2P8AQ6cme86Y1RNBsZN/mXL0/TKfFRrXuZONB9oJYk4EP5hDRdGBOwcD7CQffilC 8/6prVLPcnWioeqfu6CkSweXbmqm7gDUjKF3Mim/bFC0HNJdI3BWmiQpjzJcjTsArqr+X6oa06/jF 0Df8R7ckzs4b0FI51rXJ47NkRPoZ2VyZUz0oTZroQrUNKALUKNUdghaMhyDudqq+TO25uWDu07tUF RYYvX778DO/4OImiqECzjMVlsRPXqeYk2IP00M9lD7wqQO6U97URztj+NsErlJS1/3CqtfUQGSXD2 9yYF4ChIII/C2krmc2Zc+RSZvYHCb6IMaBYLO+g4kFf+RR6U7VulocpBohnoRA=; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Thu, 28 Nov 2024 19:53:58 +0100 Subject: [PULL for-9.2 7/7] tests/9p: also check 'Tgetattr' in 'use-after-unlink' test To: qemu-devel@nongnu.org, Peter Maydell Cc: qemu-stable@nongnu.org, Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=5.189.157.229; envelope-from=eaab44ccc59b83d8dff60fca3361a9b98ec7fee6@kylie.crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1732822764150019100 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This verifies expected behaviour of previous bug fix patch. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <7017658155c517b9665b75333a97c79aa2d4f3df.1732465720.git.qemu_o= ss@crudebyte.com> --- tests/qtest/virtio-9p-test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index f6d7400a87..ab3a12c816 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -702,6 +702,7 @@ static void fs_use_after_unlink(void *obj, void *data, g_autofree char *real_file =3D virtio_9p_test_path("09/doa_file"); g_autofree char *buf =3D g_malloc0(write_count); struct stat st_file; + struct v9fs_attr attr; uint32_t fid_file; uint32_t count; =20 @@ -725,6 +726,10 @@ static void fs_use_after_unlink(void *obj, void *data, tunlinkat({ .client =3D v9p, .atPath =3D "09", .name =3D "doa_file" }); =20 /* file is removed, but we still have it open, so this should succeed = */ + tgetattr({ + .client =3D v9p, .fid =3D fid_file, .request_mask =3D P9_GETATTR_B= ASIC, + .rgetattr.attr =3D &attr + }); count =3D twrite({ .client =3D v9p, .fid =3D fid_file, .offset =3D 0, .count =3D writ= e_count, .data =3D buf --=20 2.30.2