Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1457652lqb; Sun, 26 May 2024 01:43:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWa9pSwYaqv9/xZABz0CsOaYcoSzTIJh6nOoT2te4rBYrzOhJWiwPVAvBa4O47vv4kHGe1OL/OuxkT/rNNkhpcPOzO8hN5Zu6cLxIE12A== X-Google-Smtp-Source: AGHT+IFhaJikB+Hv0sNWZUyLkcYT1rgzYRxgCKALMBr2/6cQKlUnFzXAbf9/szigZYGFAOaaHWeA X-Received: by 2002:a05:620a:22ae:b0:794:a658:ecd4 with SMTP id af79cd13be357-794ab0993bcmr627478585a.35.1716713007764; Sun, 26 May 2024 01:43:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716713007; cv=pass; d=google.com; s=arc-20160816; b=Y/SKvh6rBiSCm0sfKto7+VSoGleWL1BN8cQKtPXtuuERmZbhMt5hE54+jM8jRYjSF+ hj3alvPbQJqwRTkZgnzN4GjVEqcOPbf0OpRSdW/M6uHADrBl2m6VZ0NG6JE1Qqv9UaUq 1w4/Hr8S9R36zEuSWfhR+lzAIrKcmE0mWzB/9Yty5zxFwKXjT0v0QGOaZML4mvDwWQ+F yiN242ZXErM7lrxP0wL08m8jeMF6RrwvgyjdC3DsRIgpt1RR3jVdXzKyG8lap8A5fHSI qXwPAHkTRTWL4Y3Npd2lotSb/GkIRyV7PhB2etv/o3YGb1ISoR1ib/3uzkBv7+T67OeO mc8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZJfc1vFjtuw6zOYBPDNoLxzMoVqWP91R11+au6coP0c=; fh=z4alJJCKKtyfWhmSb6HRukKkkb1iDhhplCAqCvTQodw=; b=tuiaD/INbLcLXRipT8GcKIN+4EPLFSGuOgeTiZxdxdiXCZqZ9jdc8gUvSdHQ4vXC2I FvEyk4Pz5XKZ8Ge8AaYP/q0ePmPCsdK/b8/pfuR67USuPlUVORXpmTOgWT4IISNbwkbo l2rHMdJisUANcqC1K0iDLutzkwMlkZ0RSiBL5nc4qzcNyiOEl8resxgXcWy7LKHeRs2/ muVk2qAxhspKeCE+9ToSHsJSn0h8Gb3FcXg9THM7J0belXV0dJTcDZ58fZJGmKDUAD5j iGvnj7kI7ZAG1P6eedzHqN8NO+CCmtaiFOxzgBkYzwS4nhh9SLjTGlqpSPgpoXDaD0Ah Z6Ag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@crudebyte.com header.s=kylie header.b=VJRvDsOv; arc=pass (i=1 spf=pass spfdomain=crudebyte.com dkim=pass dkdomain=crudebyte.com dmarc=pass fromdomain=crudebyte.com); spf=pass (google.com: domain of linux-kernel+bounces-189610-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abd5e9besi613820585a.711.2024.05.26.01.43.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 01:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189610-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@crudebyte.com header.s=kylie header.b=VJRvDsOv; arc=pass (i=1 spf=pass spfdomain=crudebyte.com dkim=pass dkdomain=crudebyte.com dmarc=pass fromdomain=crudebyte.com); spf=pass (google.com: domain of linux-kernel+bounces-189610-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=crudebyte.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7A4E41C20932 for ; Sun, 26 May 2024 08:43:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AC2C8F45; Sun, 26 May 2024 08:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=crudebyte.com header.i=@crudebyte.com header.b="VJRvDsOv" Received: from kylie.crudebyte.com (kylie.crudebyte.com [5.189.157.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4EAC2F55; Sun, 26 May 2024 08:43:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.189.157.229 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716713000; cv=none; b=hI0+KZqO1jcQNkuHqqrG1QsDwWtSUZSwFWG48MQ+0Q9FGenBKYQkshf9g34yFuAYIGujGkAttximA/je6fGlXifabsQwCLN9P1jrEUrr+SPvcfM508tEs08Ud4ZXkouKXmRT38nwUejPV2kV4XkDw7mEMqanZz0ZmxFck3YJ7Ko= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716713000; c=relaxed/simple; bh=IC8cNWH9MI/jPTfOahj8hMmSz3WbSin55lxR9NVNYpI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JD8u890iPIuOpKiltXRXmz6i8vEh1PsoE1G7ltKwzAJSLkJczdZL8Vy9kSCEnvDQxSbN33TU8gHDWC/GV7B1ZNTG1WbH+wUUQ3J5uxFjEw5ZXlSUwzVTlpcZlbxvibV59aTyXAX3lF1g13KoUTycCKnGgiLDP7Wgs7ooV2JoU9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=crudebyte.com; spf=pass smtp.mailfrom=crudebyte.com; dkim=pass (4096-bit key) header.d=crudebyte.com header.i=@crudebyte.com header.b=VJRvDsOv; arc=none smtp.client-ip=5.189.157.229 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=crudebyte.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=crudebyte.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Content-ID:Content-Description; bh=ZJfc1vFjtuw6zOYBPDNoLxzMoVqWP91R11+au6coP0c=; b=VJRvDsOvEknEP7i7MzWBmOXhPl iwPmB/FqTWfJcrwAQkepgXs0qnloSVr7zZQD+01LCyjv3S/TMYVM5E++FFDn4dfPh9vyZlsK5oIB/ 285Le1DxxT9khpXyWI7f78busZ5FukLtEJz3WEzrlavwbm3MpL41hN7SFQaTXsUt2YdhOJwD3HQvN 4INRYLiIH1sLBV8qutA8h330w1Mr84g893bRetTi0l7Y3ct++O4VtOfi0BquDA/lMKK7vm1NYSoB8 m+8znP/qESJFqR7soSg7ATt6s5kv725ZAhnHmsKX+xPE+BunFzsaIi8BZOPVfjpGDpfiMbcCGg6YY kvZ9GZUFuStcXnnFNHralzAkc5vzWcmj39Ul/XcaQLw7RLwwXxMcQhDZoV1vg3rr6Ui2lOXE3ktlK dtqKJ5DG+5mk/L7CrVU3WGmFxMC+pWtiui+Gbj7U7q1ibvZOpPhWEot6vzvh0ffJyDvGWUBjOr3xT 33B+ByzfewIeaaK8yrCwjt1ccICFKK5XA6KLVhsWpnN8M7oe4HqNcgWlEe78YhcmO56oICHGG/576 1FJ55bLJYGpS9IPpCAMrOZhWDtpFNkQUqTeMMW7dFU5hkHOv83GtmmTIo0V9NWsokepbttXFgQhC9 gQTt3LAGuYD1iLPaRf/tFgaXJVAP3IFNtqsTqum3g=; From: Christian Schoenebeck To: Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , v9fs@lists.linux.dev Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] 9p: v9fs_fid_find: also lookup by inode if not found dentry Date: Sun, 26 May 2024 10:43:04 +0200 Message-ID: <4050342.HAUgm3mvAN@silver> In-Reply-To: <20240523210024.1214386-1-asmadeus@codewreck.org> References: <20240523113638.1196299-1-asmadeus@codewreck.org> <20240523210024.1214386-1-asmadeus@codewreck.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Thursday, May 23, 2024 11:00:23 PM CEST Dominique Martinet wrote: > It's possible for v9fs_fid_find "find by dentry" branch to not turn up > anything despite having an entry set (because e.g. uid doesn't match), > in which case the calling code will generally make an extra lookup > to the server. > > In this case we might have had better luck looking by inode, so fall > back to look up by inode if we have one and the lookup by dentry failed. I'm not sure how that's supposed to happen. Both lookups check for (uid, any), just on two separate fid lists (dentry vs. inode). But OTOH I don't see no harm either, so: Reviewed-by: Christian Schoenebeck > Signed-off-by: Dominique Martinet > --- > v1 -> v2: fix build error > > Sorry, shouldn't send patches without testing even if I'm not planning > to apply them for a while... > > fs/9p/fid.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/9p/fid.c b/fs/9p/fid.c > index de009a33e0e2..f84412290a30 100644 > --- a/fs/9p/fid.c > +++ b/fs/9p/fid.c > @@ -131,10 +131,9 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any) > } > } > spin_unlock(&dentry->d_lock); > - } else { > - if (dentry->d_inode) > - ret = v9fs_fid_find_inode(dentry->d_inode, false, uid, any); > } > + if (!ret && dentry->d_inode) > + ret = v9fs_fid_find_inode(dentry->d_inode, false, uid, any); > > return ret; > } >