cifs: Fix calling CIFSFindFirst() for root path without msearch
authorPali Rohár <pali@kernel.org>
Mon, 30 Dec 2024 19:54:11 +0000 (20:54 +0100)
committerSteve French <stfrench@microsoft.com>
Sun, 27 Jul 2025 21:59:59 +0000 (16:59 -0500)
commitb460249b9a1dab7a9f58483e5349d045ad6d585c
tree4a40a2b47a34350678f117716c353c50093afdd1
parent33cfdd726381828b9907a61c038a9f48b6690a31
cifs: Fix calling CIFSFindFirst() for root path without msearch

To query root path (without msearch wildcard) it is needed to
send pattern '\' instead of '' (empty string).

This allows to use CIFSFindFirst() to query information about root path
which is being used in followup changes.

This change fixes the stat() syscall called on the root path on the mount.
It is because stat() syscall uses the cifs_query_path_info() function and
it can fallback to the CIFSFindFirst() usage with msearch=false.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifssmb.c