Message ID | 20230218003323.2322580-12-ericvh@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp149201wrn; Fri, 17 Feb 2023 16:52:34 -0800 (PST) X-Google-Smtp-Source: AK7set8lACYOoXrhjgH2BhJkV2U/79vJ6UETCa04XB3FwiD1cJ05tPZtrDwVuYfNrl2ZkTltqqkz X-Received: by 2002:a17:903:187:b0:19a:a6cd:35a8 with SMTP id z7-20020a170903018700b0019aa6cd35a8mr8386812plg.25.1676681553929; Fri, 17 Feb 2023 16:52:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676681553; cv=none; d=google.com; s=arc-20160816; b=oi7/VccFkVsaI3skXkazEa3pc3weLNF7dVbVxH7AnoxX2ePoLnz9olwwzmSNQ+2TD+ ynqqlz6/8hVIgSNN6FYhSl+ruF4xhE47/WKkQOqlhpO/PWfedpIKEilSR4xuj2rtP/WJ wR93t0hbAsFGgAkJHbZnejlsxl24TJCnXmd/eBVOgWFQcfdyiM40zaTRO9sKlNTVU0X8 Z/o53jnpQopbFp2E1fPb0B1ao9Rzp6lbJwcUUc8padWyDDQKwLFakZZV3r0NrdlgSIom bXhtOVVs19L1oJghCprtYn3AP21Fzazg/z4LXJ9MZ5UUmrBniLjQBcCRdtPP+Hhw7q3m YDPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4ca/fSLz84+8zt25NEHBciinMYKl2LpEMEovBvxwZ9Y=; b=liy6icuXtmnOUNIAI9yVnOkdjdfoayu8qfHgEeN5s5euXNMs3sMu9GWmAe3GT1zdFw JU4KmpTMNj2mNuCX3IgAvGxjODo5W4W3UsP5ENWaHYcpY3PbAHR1vAARRaHNlh+cH2w9 tL7HdtF1A0VNP35bgW0dq9autdeB2HtkmsHWWlEVU0xH4fJPLI59hs6ddlFLFtasdwXN 15EmQUXv8OSilzFa9R2LMbZ15oB5Cy147aVfZ33POjKfkkUjy7we5rXH5IvuYfpmfh7d GoOqMIVYWt6YuLF57TUKlQHUICa09IPSnR+MQ4hyrz/lAjLzNQJ6QdN6IvWL1KW6y0/I F4qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AnkqWYzF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e4-20020a635004000000b004fb165e159bsi5678067pgb.794.2023.02.17.16.52.21; Fri, 17 Feb 2023 16:52:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AnkqWYzF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbjBRAs0 (ORCPT <rfc822;daweilics@gmail.com> + 99 others); Fri, 17 Feb 2023 19:48:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjBRAsY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 17 Feb 2023 19:48:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BBA1193F9; Fri, 17 Feb 2023 16:47:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 01D01620AE; Sat, 18 Feb 2023 00:34:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 938A9C433D2; Sat, 18 Feb 2023 00:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676680445; bh=fE7TnKGk+7sECniXW1Co7rrNpfck1npdV3aCIbmWvVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AnkqWYzFMTcdBZm4UR/n3WPvCPfwOaEkymB8fMNPzSu0yOxGLVyau2YonIEyaQqoL H1m4s4pnyONyULyAczlSbveBWREsET+3AZnQvVr4sFVPoAraoRstlRDW6lPMP7r6sW JRybBRGFFujDXu1tXKRT4axSewCYNlRcsbjD9pw8XxGl0dOkA0kU/UXUkV2npA5J44 HpQr5oj/1qWUKUfbEVz5eb1EIRclPNLvl5RzZiDwy9Mp76CoaCttX1bgibxDb5KiUB d+3vnLsbMfPviaSfeaSy2zMxKTpYZxc5BKlfl7BtGImwSvyHie7kCN9dknVu4ClUGO IzO9GwMrSJcdw== From: Eric Van Hensbergen <ericvh@kernel.org> To: v9fs-developer@lists.sourceforge.net, asmadeus@codewreck.org, rminnich@gmail.com, lucho@ionkov.net Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux_oss@crudebyte.com, Eric Van Hensbergen <ericvh@kernel.org> Subject: [PATCH v4 11/11] fs/9p: Fix revalidate Date: Sat, 18 Feb 2023 00:33:23 +0000 Message-Id: <20230218003323.2322580-12-ericvh@kernel.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230218003323.2322580-1-ericvh@kernel.org> References: <20230124023834.106339-1-ericvh@kernel.org> <20230218003323.2322580-1-ericvh@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758128036828850117?= X-GMAIL-MSGID: =?utf-8?q?1758128036828850117?= |
Series |
Performance fixes for 9p filesystem
|
|
Commit Message
Eric Van Hensbergen
Feb. 18, 2023, 12:33 a.m. UTC
Unclear if this case ever happens, but if no inode in dentry, then
the dentry is definitely invalid. Seemed to be the opposite in the
existing code.
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
---
fs/9p/vfs_dentry.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
Eric Van Hensbergen wrote on Sat, Feb 18, 2023 at 12:33:23AM +0000: > Unclear if this case ever happens, but if no inode in dentry, then > the dentry is definitely invalid. Seemed to be the opposite in the > existing code. Looking at other implementations of d_revalidate (ecryptfs, cifs, vfat) it seems to be assumed that the inode is always valid. I'd just remove the if, or if we keep it add a WARN or something for a while so we can remove it in a few releases? (That said, it's better to return 0 than 1 here, so don't take this for a no -- progress is progress)
diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c index 65fa2df5e49b..b0c3f8e8ea00 100644 --- a/fs/9p/vfs_dentry.c +++ b/fs/9p/vfs_dentry.c @@ -68,7 +68,7 @@ static int v9fs_lookup_revalidate(struct dentry *dentry, unsigned int flags) inode = d_inode(dentry); if (!inode) - goto out_valid; + return 0; v9inode = V9FS_I(inode); if (v9inode->cache_validity & V9FS_INO_INVALID_ATTR) { @@ -91,7 +91,6 @@ static int v9fs_lookup_revalidate(struct dentry *dentry, unsigned int flags) if (retval < 0) return retval; } -out_valid: return 1; }