Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.com>
To: Shyam Prasad N <nspmangalore@gmail.com>,
	Steve French <smfrench@gmail.com>,
	Bharath SM <bharathsm.hsk@gmail.com>,
	CIFS <linux-cifs@vger.kernel.org>,
	David Howells <dhowells@redhat.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: Negative dentries on Linux SMB filesystems
Date: Mon, 13 Jan 2025 12:25:37 -0300	[thread overview]
Message-ID: <eed163634d34c59bdfe3071c782276c2@manguebit.com> (raw)
In-Reply-To: <CANT5p=o-1V2ea-+Lj+M0h4=syXyJYu73JU3F0dXij=KVwWUTOw@mail.gmail.com>

Shyam Prasad N <nspmangalore@gmail.com> writes:

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

This is a network filesystem.  If the last lookup ended up with a
negative dentry in dcache, that doesn't mean the file won't exist the
next time we look it up again.  The file could have been created by a
different client, so we need to query it on server.

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

I think we do.  Check the places where we return 0 from
cifs_d_revalidate(), meaning that the dentry will need to be looked up
again and hopefully instantiated (e.g. file was created on server).

> 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 don't think so.

Al, am I missing someting?

  reply	other threads:[~2025-01-13 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-13  5:38 Negative dentries on Linux SMB filesystems Shyam Prasad N
2025-01-13 15:25 ` Paulo Alcantara [this message]
2025-01-13 15:42   ` Shyam Prasad N
2025-01-13 16:29     ` Paulo Alcantara
2025-01-15 11:09       ` Shyam Prasad N

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=eed163634d34c59bdfe3071c782276c2@manguebit.com \
    --to=pc@manguebit.com \
    --cc=bharathsm.hsk@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=nspmangalore@gmail.com \
    --cc=smfrench@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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