NeilBrown <[email protected]>
Newsgroups org.kernel.vger.linux-cifs,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
From: NeilBrown <[email protected]>
To: David Howells <[email protected]>,
	Marc Dionne <[email protected]>
Cc: [email protected],
	[email protected]
Subject: [PATCH 0/2] afs: avoid unhash/rehash
Date: Thu,  2 Jul 2026 11:58:28 +1000
Message-ID: <[email protected]>
X-Mailer: git-send-email 2.50.0.107.gf914562f5916.dirty
Reply-To: NeilBrown <[email protected]>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

cifs (like nfs and afs) needs to block "open" requests while
processing an unlink or rename because if the target is to be unlinked
on the server, then the open must fail or create a new file, which needs
to wait for the unlink to complete.

It does this by unhashing the dentry and later rehashing it.  This will
cause problems for proposed changes to locking which will lock the
dentry rather than the parent directory.  Unhashing will effectively
unlock the name.

The second patch here addresses this by using ->d_fsdata to mark a
dentry as being busy in unlink/rename and waiting in d_revalidate for
that mark to be removed.  This is the same approach that NFS has used
for a while.

The first patch frees up ->d_fsdata which is currently otherwised used.
It is being used for a purpose that ->d_time is more suitable for so the
first patch switches to use d_time.

10 years ago cifs *did* use ->d_time but was changed to use ->d_fsdata
by Miklos with no justification (a00be0e31f8d).  Miklos: do you have any
memory of why that was done?

Thanks,
NeilBrown

 [PATCH 1/2] smb/client: use d_time to store a timestamp in dentry,
 [PATCH 2/2] smb/client: don't unhashed and rehash to prevent new
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.