Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.com>
To: Shyam Prasad N <nspmangalore@gmail.com>
Cc: 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 13:29:37 -0300	[thread overview]
Message-ID: <6f1f7984ded4a0152854ecc07b0ab56d@manguebit.com> (raw)
In-Reply-To: <CANT5p=rEjCwxm8t_zayJ3VGTcXYgBgnSaeFUHwkpuL0DfZY0=Q@mail.gmail.com>

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

> Hi Paulo,
>
> Thanks for your replies.
>
> On Mon, Jan 13, 2025 at 8:55 PM Paulo Alcantara <pc@manguebit.com> wrote:
>>
>> 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 agree. But we do have tools to trade performance for accuracy using
> parameters like actimeo/acdirmax/acregmax.

Do you mean using these parameters for negative dentries?  These are
used for caching file attributes of files and directories, which means
they are all positive dentries.

> So we can avoid going to the server each time if it's within some interval.
> If the server gives us dir leases, we can be sure that the dentries
> have not changed without us knowing. So we can definitely cache the
> negative dentries till as long as we have the lease.

Yes, that could be done with directory leases.

Note that negative dentries are also cached when @lookupCacheEnabled is
set.

  reply	other threads:[~2025-01-13 16:29 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
2025-01-13 15:42   ` Shyam Prasad N
2025-01-13 16:29     ` Paulo Alcantara [this message]
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=6f1f7984ded4a0152854ecc07b0ab56d@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