Linux CIFS filesystem development
 help / color / mirror / Atom feed
* Negative dentries on Linux SMB filesystems
@ 2025-01-13  5:38 Shyam Prasad N
  2025-01-13 15:25 ` Paulo Alcantara
  0 siblings, 1 reply; 5+ messages in thread
From: Shyam Prasad N @ 2025-01-13  5:38 UTC (permalink / raw)
  To: Steve French, Paulo Alcantara, Bharath SM, CIFS, David Howells

Hi,

Negative dentry is a VFS concept where it maintains a cache of
dentries even for files that do not exist. This can come in handy for
situations where they are looked up. For example, many applications
first check the existence of a file before creating it.

Ideally, negative dentries should allow a filename lookup to happen
entirely from the dentry cache if the lookup had happened once
already. But I noticed that the SMB client goes to the server every
time we do a stat of a file that does not exist.

I investigated this more and it looks like vfs_getattr does make use
of negative dentry, but the revalidate always comes to
cifs_d_revalidate even for negative dentries. And we do not have the
code necessary to deal with it. We do use d_really_is_positive before
we do the dentry validation, but it looks like that comes to us as
success, even in case of non-existent dentries. Is this expected?

I compared the revalidate code on the NFS client, and it does look
like nfs_neg_need_reval deals with this situation based on some
heuristics.

-- 
Regards,
Shyam

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-15 11:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-13  5:38 Negative dentries on Linux SMB filesystems Shyam Prasad N
2025-01-13 15:25 ` Paulo Alcantara
2025-01-13 15:42   ` Shyam Prasad N
2025-01-13 16:29     ` Paulo Alcantara
2025-01-15 11:09       ` Shyam Prasad N

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox