From patchwork Sat Jun 26 16:09:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12346507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F222BC49EA6 for ; Sat, 26 Jun 2021 16:10:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAD2461A2B for ; Sat, 26 Jun 2021 16:10:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbhFZQMZ (ORCPT ); Sat, 26 Jun 2021 12:12:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbhFZQMY (ORCPT ); Sat, 26 Jun 2021 12:12:24 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75AD0C061574 for ; Sat, 26 Jun 2021 09:10:01 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id o6so22577128qkh.4 for ; Sat, 26 Jun 2021 09:10:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=NxI2is3Iv3dnXBkmQ7htNCEMaScbMxxzbk1XUvUBKfw=; b=h00eHusbwN3I4AXlLayN94SErEp7Y/DgVWm8hbTBX7HzESUfb3IvJoY6lCjUxG3vjM mC3ULzmc4Z36LEb/lxHSYhy7MGTtcROfw/ltR8LTIdXYuRB7d1U30+K72sscPZLuafbw 7qwsPXeO8+YgFE6hgVQ3wW7V+b6pb8h4OW3SkYi8iohRvADzWYc44oycn9xr08nAS/Rt eMoE9GnYi/G5BxBHVmQIOLbnPpPeqvrbF+G+G+yAhqBkfrS+/2vOC0w47vqfpveiVBLh ZcRp8RqzKqZadqKlS0L0MwLO93n8isRcFMQV2Iz9+XjARJT/3RJ6pWu65u/v3kTdJlyd KXbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NxI2is3Iv3dnXBkmQ7htNCEMaScbMxxzbk1XUvUBKfw=; b=COZCbF9kLrY4gm6XZScTlEFOLovj4havXsJlIkeYI8kXMKpv56Agp7QfYHCqMibmsQ Cks3/oSsk/KLOPY3ceSR7mxeTYuMEV1vJ2pfaBsX1iFh3l6t2U8LNP93RznrSKkEjrOV BPgyuv9tqtjXAzhlUrma0daxqq3Kr261wHcZmU0sZhMxjN/3AsQE/J1fPDeMc9s0IEhy wdK3i1I/XGwLFgY5yKfsO6D6yE/kZmSuj/V6hNhsvnXg0fiRV91P732hZqaB25jg5cwf XYevAgb8MqwTMTK/Dj1MWHZerQzHayPjCoR3d5u2ci9Rms4WNNXWwM/BamsF+EOuX65j GOpA== X-Gm-Message-State: AOAM532QJaCu/qOyodAP+viwcaibYhLFrk0NErUOfB5LU7MciBBapRjL o30VIb3IW8yM79KYuL1Hrbd48oerhwmW X-Google-Smtp-Source: ABdhPJxbM2VJs2b+Jl4b1A7Ej1pwKXji4wq/mE/iZRh8bCXKQrIjRu35B9pTGRgg43Cfm1Sr73MunQ== X-Received: by 2002:a05:620a:109a:: with SMTP id g26mr17026131qkk.450.1624723800351; Sat, 26 Jun 2021 09:10:00 -0700 (PDT) Received: from leira.hammer.space (c-68-36-133-222.hsd1.mi.comcast.net. [68.36.133.222]) by smtp.gmail.com with ESMTPSA id s8sm2995141qke.72.2021.06.26.09.09.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Jun 2021 09:09:59 -0700 (PDT) From: trondmy@gmail.com X-Google-Original-From: trond.myklebust@hammerspace.com To: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] NFSv4: Just don't cache negative dentries on case insensitive servers Date: Sat, 26 Jun 2021 12:09:56 -0400 Message-Id: <20210626160956.323472-3-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210626160956.323472-2-trond.myklebust@hammerspace.com> References: <20210626160956.323472-1-trond.myklebust@hammerspace.com> <20210626160956.323472-2-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust If the directory contents change, we cannot rely on the negative dentry being cacheable. Signed-off-by: Trond Myklebust --- fs/nfs/dir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 1a6d2867fba4..eda0d816cbd1 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1438,6 +1438,9 @@ int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry, return 0; if (NFS_SERVER(dir)->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) return 1; + /* Case insensitive server? Revalidate negative dentries */ + if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE)) + return 1; return !nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU); }