From: David Howells <dhowells@redhat.com>
To: NeilBrown <neil@brown.name>
Cc: dhowells@redhat.com, Marc Dionne <marc.dionne@auristor.com>,
linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] afs: use d_time instead of d_fsdata
Date: Thu, 02 Jul 2026 09:54:20 +0100 [thread overview]
Message-ID: <139684.1782982460@warthog.procyon.org.uk> (raw)
In-Reply-To: <20260702020350.3403907-2-neilb@ownmail.net>
NeilBrown <neilb@ownmail.net> wrote:
> afs uses ->d_fsdata to store version information for the parent
> directory. ->d_time is arguably a better field to store this
> information as the version is like a time stamp, and ->d_time is an
> unsigned long, while ->d_fsdata is a void *.
It wasn't clear that ->d_time was available for private use by the filesystem.
> This will leave ->d_fsdata free for a different use ... which
> admittedly is also not a void*, but is certainly not at all a time.
Are you going to use ->d_fsdata for something generic?
> Interestingly the value stored in ->d_time or d_fsdata is u64 which does
> not fit in "unsigned long" or "void *" on 32 bit hosts. Maybe that
> doesn't matter.
I know. I just have to hope that someone triggers revalidation on a dirent
before 4 billion changes have been made to the directory on a 32-bit machine.
I could use both d_time and d_fsdata on 32-bit, I suppose. I really don't
want to allocate an 8-byte blob for each dentry.
Maybe I should switch to a single-bit flag and "invalidate" all the dentries
attached to a directory if I detect a jump in the directory's version number
due to a third-party modification (the version is monotonically incremented
for each modification committed).
I'm not sure how to do a mass invalidation without risking deadlock, though,
because I'd quite likely be starting from a random dirent in a directory and
then have to walk through all the other dirents of the directory. I suppose I
could lock the directory (probably using dvnode->validate_lock) and then walk
through d_children.
David
next prev parent reply other threads:[~2026-07-02 8:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 1:58 [PATCH 0/2] afs: avoid unhash/rehash NeilBrown
2026-07-02 1:58 ` [PATCH 1/2] afs: use d_time instead of d_fsdata NeilBrown
2026-07-02 8:54 ` David Howells [this message]
2026-07-02 10:12 ` NeilBrown
2026-07-02 9:09 ` David Howells
2026-07-02 10:27 ` NeilBrown
2026-07-02 10:53 ` David Howells
2026-07-02 1:58 ` [PATCH 2/2] afs: don't unhash/rehash dentries during unlink/rename NeilBrown
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=139684.1782982460@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=marc.dionne@auristor.com \
--cc=neil@brown.name \
/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