From nobody Mon Feb 9 12:38:45 2026 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=1625486384; cv=none; d=zohomail.com; s=zohoarc; b=SvrxMl5Ww7Yx5Dzz8Y/kmXzILF9Jeqh/udhh53Q5lWX7Yt59HxxuNeDLOHxx/6Yoz+5A6y3WuJBBEg3pdTCsaIrRY88720UouVMrqGaBLkZgnWBJZdUwEGolZvNyaIhohbrxE8Fv6h9g0yszv3Y1wWMOT7UhEecEKXiQFJuqzgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625486384; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=2PeUQRFF1okpWE4jlq0lT7l7JXEpBQ/kI+ArKDSq7+E=; b=FmE2JQ1TU4cEjOcSeeUpRjf9I7d5Zk7oGBaS8F01xE9pzo3tZlNInhwAvtrrBTjvtw/wqPuhtIzRzNvvE43Lzb5yPlsMkGM6ADGjZXOv60ZYYMAuYFOxIJlhXUgygzlYHudW3nUhjPD0wlszzXWOZdYsEnU/zYe3JzHChL1+xwA= 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 1625486384532886.2720480552817; Mon, 5 Jul 2021 04:59:44 -0700 (PDT) Received: from localhost ([::1]:37730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0NGJ-00040T-GN for importer@patchew.org; Mon, 05 Jul 2021 07:59:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0NEP-0001QG-Nc for qemu-devel@nongnu.org; Mon, 05 Jul 2021 07:57:45 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:49279) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0NEO-0007O1-5o for qemu-devel@nongnu.org; Mon, 05 Jul 2021 07:57:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=2PeUQRFF1okpWE4jlq0lT7l7JXEpBQ/kI+ArKDSq7+E=; b=R/C9f M60+vm+uF6T0sfCfw0Fs9pfRgTI78BFeBU8lr5nIjCpC5FD6fNhF9jUE+ka0BenrO5GVsIDCwpRWL g7+55LUaxDG+tDmnhLhMG5+KfCBD8BM5wiF/GBID3LE8jSPbfqam3BaELFVT7s7MS8Bwnpv8vVw63 RliSjoJ7GusucdivU2x5KmCGfJ/+Y8jfq/bfroYx/gLTUXX/voNTmpysd7s85y3InyQOkTnCoDfaf sij+be/81P2+svh+pOuUaW/NTU5f3N2dAu97ZBlRemIoUPIyZ5wLk81lEq96nr/dRU12g7O4ydW67 IDlzz0rrHiCDmz/XrqvHHWPl9P6FA==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Mon, 05 Jul 2021 13:13:51 +0200 Subject: [PULL 6/8] 9pfs: replace not_same_qid() by same_stat_id() To: qemu-devel@nongnu.org, Peter Maydell Cc: 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: none client-ip=91.194.90.13; envelope-from=f22cad42281621f86a0756a7cff382f90a33ec8c@lizzy.crudebyte.com; helo=lizzy.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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1625486386465100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" As we are actually only comparing the filesystem ID (i.e. device number and inode number pair) let's use the POSIX stat buffer instead of QIDs, because resolving QIDs requires to be done on 9p server's main thread only as it might mutate the server state if inode remapping is enabled. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <26aa465ff9cc9c07e053331554a02fdae3994417.1622821729.git.qemu_o= ss@crudebyte.com> --- hw/9pfs/9p.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 0e3857798d..47b000d3a9 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1696,9 +1696,9 @@ static bool name_is_illegal(const char *name) return !*name || strchr(name, '/') !=3D NULL; } =20 -static bool not_same_qid(const V9fsQID *qid1, const V9fsQID *qid2) +static bool same_stat_id(const struct stat *a, const struct stat *b) { - return qid1->path !=3D qid2->path; + return a->st_dev =3D=3D b->st_dev && a->st_ino =3D=3D b->st_ino; } =20 static void coroutine_fn v9fs_walk(void *opaque) @@ -1771,7 +1771,7 @@ static void coroutine_fn v9fs_walk(void *opaque) v9fs_path_copy(&dpath, &fidp->path); v9fs_path_copy(&path, &fidp->path); for (name_idx =3D 0; name_idx < nwnames; name_idx++) { - if (not_same_qid(&pdu->s->root_qid, &qid) || + if (!same_stat_id(&pdu->s->root_st, &stbuf) || strcmp("..", wnames[name_idx].data)) { err =3D v9fs_co_name_to_path(pdu, &dpath, wnames[name_idx].dat= a, &path); --=20 2.20.1