linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Chuck Lever <cel@kernel.org>
Cc: hughd@google.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v1] shmem: stable directory cookies
Date: Tue, 2 May 2023 17:12:28 -0700	[thread overview]
Message-ID: <20230502171228.57a906a259172d39542e92fb@linux-foundation.org> (raw)
In-Reply-To: <168175931561.2843.16288612382874559384.stgit@manet.1015granger.net>

On Mon, 17 Apr 2023 15:23:10 -0400 Chuck Lever <cel@kernel.org> wrote:

> From: Chuck Lever <chuck.lever@oracle.com>
> 
> The current cursor-based directory cookie mechanism doesn't work
> when a tmpfs filesystem is exported via NFS. This is because NFS
> clients do not open directories: each READDIR operation has to open
> the directory on the server, read it, then close it. The cursor
> state for that directory, being associated strictly with the opened
> struct file, is then discarded.
> 
> Directory cookies are cached not only by NFS clients, but also by
> user space libraries on those clients. Essentially there is no way
> to invalidate those caches when directory offsets have changed on
> an NFS server after the offset-to-dentry mapping changes.
> 
> The solution we've come up with is to make the directory cookie for
> each file in a tmpfs filesystem stable for the life of the directory
> entry it represents.
> 
> Add a per-directory xarray. shmem_readdir() uses this to map each
> directory offset (an loff_t integer) to the memory address of a
> struct dentry.
> 

How have people survived for this long with this problem?

It's a lot of new code - can we get away with simply disallowing
exports of tmpfs?

How can we maintain this?  Is it possible to come up with a test
harness for inclusion in kernel selftests?


  parent reply	other threads:[~2023-05-03  0:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17 19:23 Chuck Lever
2023-04-20 18:52 ` Jeff Layton
2023-04-20 20:12   ` Chuck Lever III
2023-05-03  0:12 ` Andrew Morton [this message]
2023-05-03  0:43   ` Chuck Lever III
2023-05-04 17:21     ` Jeff Layton
2023-05-04 20:21     ` Benjamin Coddington
2023-05-05  5:06 ` kernel test robot

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=20230502171228.57a906a259172d39542e92fb@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cel@kernel.org \
    --cc=hughd@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.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