[PATCH 1/2] afs: use d_time instead of d_fsdata
David Howells
dhowells at redhat.com
Thu Jul 2 02:09:30 PDT 2026
NeilBrown <neilb at 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 *.
Might it be better to rename ->d_time to ->d_version, since that would seem to
be more in line with how it's used?
> 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.
Hmmm... It looks like NFS may have a bug here:
static int nfs_dentry_verify_change(struct inode *dir, struct dentry *dentry)
{
if (nfs_server_capable(dir, NFS_CAP_CASE_INSENSITIVE) &&
d_really_is_negative(dentry))
return dentry->d_time == inode_peek_iversion_raw(dir);
return nfs_verify_change_attribute(dir, dentry->d_time);
}
dentry->d_time may be 32-bits, but inode_peek_iversion_raw() is always 64 bits
and i_version is set to the 64-bit fattr->change_attr.
David
More information about the linux-afs
mailing list