From: Trond Myklebust <trondmy@hammerspace.com>
To: "daire@dneg.com" <daire@dneg.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: directory caching & negative file lookups?
Date: Fri, 5 Apr 2024 15:03:16 +0000 [thread overview]
Message-ID: <17e2bf4c718a7cfdc34131978ad03656d0622de5.camel@hammerspace.com> (raw)
In-Reply-To: <CAPt2mGNYaeMxx4UCEKkaFjxk3K7hAhv8A9ARuPwhLx2yoOBv7Q@mail.gmail.com>
On Fri, 2024-04-05 at 15:47 +0100, Daire Byrne wrote:
> Apologies for dragging up an old thread, but I've had to tackle
> wayward negative lookup storms again and I have obviously half
> forgotten what I learned in this thread last time (even after
> re-reading it!).
>
> Can I just ask if I understand correctly and that there was an
> intention a long time ago to be able to serve negative dentries from
> a
> "complete" READDIRPLUS result?
>
> https://www.cs.helsinki.fi/linux/linux-kernel/2002-30/0108.html
>
> So if we did a readdirplus on a directory then immediately fired
> random non existent lookups at the directory, it could be served from
> the readdirplus result? i.e. not in readdir result, then return
> ENOENT
> without needing to ask server?
>
> But that is not the case today because you can't track the
> "completeness" of a READDIRPLUS result for a directory over time (in
> page cache)? Or is it all due to needing to deal with case
> insensitive
> filesystems (which I would think effects positive lookups too)?
>
> I did try to decipher the v6.6 fs/nfs/dir.c READDIR bits but I
> quickly
> got lost...
>
> Cheers,
>
> Daire
If the question is whether the client trusts that a READDIR call to the
server returns all the names that can be successfully looked up, then
the answer is "no".
It's not even a question of case sensitivity. There are plenty of
servers out there that will allow you to look up names that won't ever
appear in the results of a READDIR (or READDIRPLUS) call. Having a
hidden ".snapshot" directory is, for instance, a popular way to present
snapshots.
So no, we're not ever going to implement any negative dentry cache
scheme that relies on READDIR/READDIRPLUS.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
next prev parent reply other threads:[~2024-04-05 15:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 13:32 directory caching & negative file lookups? Daire Byrne
2022-09-01 13:55 ` Trond Myklebust
2022-09-01 15:27 ` Daire Byrne
2022-09-01 15:43 ` Trond Myklebust
2022-09-01 15:49 ` Daire Byrne
2024-04-05 14:47 ` Daire Byrne
2024-04-05 15:03 ` Trond Myklebust [this message]
2024-04-12 9:11 ` Daire Byrne
2024-04-12 10:21 ` Jeff Layton
2024-04-12 11:43 ` Daire Byrne
2024-04-12 14:13 ` Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17e2bf4c718a7cfdc34131978ad03656d0622de5.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=daire@dneg.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).