[PATCH 1/2] afs: use d_time instead of d_fsdata

NeilBrown neilb at ownmail.net
Thu Jul 2 03:27:31 PDT 2026


On Thu, 02 Jul 2026, David Howells wrote:
> 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?

Maybe.
 fuse and kernfs store an incrementing version number, like afs
 cifs and vboxsf store jiffies
 nfs stores whatever the server provides, which might be a counter or
   might be a timestamp.

So d_version is arguably slightly better than d_time.

> 
> > 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.

I wonder if there would be any appetite for making d_time (or d_version)
always 64bit, much like i_ino was recently changed to u64.

NeilBrown



More information about the linux-afs mailing list