Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Henrique Carvalho <henrique.carvalho@suse.com>
To: Enzo Matsumiya <ematsumiya@suse.de>
Cc: smfrench@gmail.com, linux-cifs@vger.kernel.org
Subject: Re: [PATCH 3/6] smb: client: short-circuit negative lookups when parent dir is fully cached
Date: Fri, 19 Sep 2025 17:49:22 -0300	[thread overview]
Message-ID: <ef49e995-3dba-4a2d-8e3a-6d5c2bec0843@suse.com> (raw)
In-Reply-To: <grz6l27jndyzc4mztngv2wslloimamsvu6jztchbijsmzitybr@nl6xeyjqh3wp>

Thanks, Enzo.

I'll address the comments in an updated patch.

On 9/19/25 3:54 PM, Enzo Matsumiya wrote:
> On 09/19, Henrique Carvalho wrote:
>> When the parent directory has a valid and complete cached enumeration we
>> can assume that negative dentries are not present in the directory, thus
>> we can return without issuing a request.
>>
>> This reduces traffic for common ENOENT when the directory entries are
>> cached.
>>
>> Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
> 
> (unrelated to the patch)
> Can a dentry ever get here being positive?  AFAICS it can't, but I might
> have missed some obscure code path.

AFAICS no, but I would also like someone else to confirm.

> 
>> +
>> +        /*
>> +         * We can only rely on negative dentries having the same
>> +         * spelling as the cached dirent if case insensitivity is
>> +         * forced on mount.
>> +         *
>> +         * XXX: if servers correctly announce Case Sensitivity Search
>> +         * on GetInfo of FileFSAttributeInformation, then we can take
>> +         * correct action even if case insensitive is not forced on
>> +         * mount.
>> +         *
>> +         */
> 
> If you're going into the case-sensitiveness hole, several other things
> can be fixed re: cached dirs (and other areas, as we know lol):
> 
>   # mount ... /mnt # not using nocase
>   # cd /mnt
>   # mkdir abc
>   # ls
>   # ls abc
>   # ls ABC
>   # ls ABc
>   # cat /proc/fs/cifs/open_dirs
>   # Version:1
>   # Format:
>   # <tree id> <sess id> <persistent fid> <path>
>   Num entries: 4
>   0x5 0x1d800a8000021 0x760051e015     \ABc       valid file info, valid
> dirents
>   0x5 0x1d800a8000021 0x760051e012     \ABC       valid file info, valid
> dirents
>   0x5 0x1d800a8000021 0x760051e00f     \abc       valid file info, valid
> dirents
>   0x5 0x1d800a8000021 0x760051e00c        valid file info, valid dirents

Agree. The code can likely be improved for users who don't care about
case-exact matching.

> So, as I understand, for the 'nocase' cases, it might be worth building
> the path string and comparing with strcasecmp().
> 
> Other than that, this seems to work fine though.
> 
> (also, extra line at the end of the comment)
> 

-- 
Henrique
SUSE Labs

  reply	other threads:[~2025-09-19 20:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 15:24 [PATCH 1/6] smb: client: ensure open_cached_dir_by_dentry() only returns valid cfid Henrique Carvalho
2025-09-19 15:24 ` [PATCH 2/6] smb: client: short-circuit in open_cached_dir_by_dentry() if !dentry Henrique Carvalho
2025-09-19 16:15   ` Enzo Matsumiya
2025-09-19 15:24 ` [PATCH 3/6] smb: client: short-circuit negative lookups when parent dir is fully cached Henrique Carvalho
2025-09-19 18:54   ` Enzo Matsumiya
2025-09-19 20:49     ` Henrique Carvalho [this message]
2025-09-19 15:24 ` [PATCH 4/6] smb: client: update cfid->last_access_time in open_cached_dir_by_dentry() Henrique Carvalho
2025-09-19 15:24 ` [PATCH 5/6] smb: client: remove pointless cfid->has_lease check Henrique Carvalho
2025-09-19 18:55   ` Enzo Matsumiya
2025-10-02  3:39     ` Steve French
2025-09-19 15:24 ` [PATCH 6/6] smb: client: remove unused fid_lock Henrique Carvalho
2025-09-19 18:56   ` Enzo Matsumiya
2025-09-19 15:55 ` [PATCH 1/6] smb: client: ensure open_cached_dir_by_dentry() only returns valid cfid Enzo Matsumiya
2025-10-02  3:10   ` Steve French

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=ef49e995-3dba-4a2d-8e3a-6d5c2bec0843@suse.com \
    --to=henrique.carvalho@suse.com \
    --cc=ematsumiya@suse.de \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /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