linux/fs/smb/client
Bharath SM 72dd7961a4 smb: improve directory cache reuse for readdir operations
Currently, cached directory contents were not reused across subsequent
'ls' operations because the cache validity check relied on comparing
the ctx pointer, which changes with each readdir invocation. As a
result, the cached dir entries was not marked as valid and the cache was
not utilized for subsequent 'ls' operations.

This change uses the file pointer, which remains consistent across all
readdir calls for a given directory instance, to associate and validate
the cache. As a result, cached directory contents can now be
correctly reused, improving performance for repeated directory listings.

Performance gains with local windows SMB server:

Without the patch and default actimeo=1:
 1000 directory enumeration operations on dir with 10k files took 135.0s

With this patch and actimeo=0:
 1000 directory enumeration operations on dir with 10k files took just 5.1s

Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
2025-06-12 13:38:21 -05:00
..
compress move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
asn1.c smb3: add support for IAKerb 2025-01-31 12:51:44 -06:00
cached_dir.c 13 smb3/cifs client fixes 2025-06-03 16:04:29 -07:00
cached_dir.h smb: improve directory cache reuse for readdir operations 2025-06-12 13:38:21 -05:00
cifs_debug.c smb: client: make use of common smbdirect_socket_parameters 2025-06-03 18:42:47 -05:00
cifs_debug.h
cifs_fs_sb.h smb:client: smb: client: Add reverse mapping from tcon to superblocks 2025-03-31 21:12:31 -05:00
cifs_ioctl.h smb3: allow dumping session and tcon id to improve stats analysis and debugging 2023-11-10 02:00:30 -06:00
cifs_spnego.c smb3: add support for IAKerb 2025-01-31 12:51:44 -06:00
cifs_spnego.h
cifs_spnego_negtokeninit.asn1
cifs_swn.c
cifs_swn.h
cifs_unicode.c cifs: Fix creating native symlinks pointing to current or parent directory 2024-10-06 22:57:12 -05:00
cifs_unicode.h
cifsacl.c cifs: add validation check for the fields in smb_aces 2025-03-26 14:51:14 -05:00
cifsacl.h smb: client: Correct typos in multiple comments across various files 2024-10-02 17:52:24 -05:00
cifsencrypt.c smb: client: fix UAF in decryption with multichannel 2025-04-09 10:24:55 -05:00
cifsfs.c 13 smb3/cifs client fixes 2025-06-03 16:04:29 -07:00
cifsfs.h cifs: update internal version number 2025-06-05 10:21:17 -05:00
cifsglob.h cifs: serialize other channels when query server interfaces is pending 2025-06-03 18:42:47 -05:00
cifspdu.h cifs: Correctly set SMB1 SessionKey field in Session Setup Request 2025-06-01 20:43:49 -05:00
cifsproto.h vfs-6.16-rc1.netfs 2025-06-02 15:04:06 -07:00
cifsroot.c
cifssmb.c 13 smb3/cifs client fixes 2025-06-03 16:04:29 -07:00
compress.c smb/client: Fix logically dead code 2024-10-16 00:30:52 -05:00
compress.h smb: client: compress: LZ77 code improvements cleanup 2024-09-15 10:42:45 -05:00
connect.c smb: client: disable path remapping with POSIX extensions 2025-06-09 15:59:03 -05:00
dfs.c smb: client: don't trust DFSREF_STORAGE_SERVER bit 2025-02-05 21:09:00 -06:00
dfs.h smb: client: get rid of kstrdup() in get_ses_refpath() 2025-02-05 21:09:07 -06:00
dfs_cache.c smb: client: get rid of kstrdup() in get_ses_refpath() 2025-02-05 21:09:07 -06:00
dfs_cache.h
dir.c smb: client: use ParentLeaseKey in cifs_do_create 2025-06-01 20:46:45 -05:00
dns_resolve.c smb: client: provide dns_resolve_{unc,name} helpers 2025-01-19 19:34:00 -06:00
dns_resolve.h smb: client: provide dns_resolve_{unc,name} helpers 2025-01-19 19:34:00 -06:00
export.c
file.c smb: client: fix perf regression with deferred closes 2025-06-12 12:42:48 -05:00
fs_context.c smb: client: ensure aligned IO sizes 2025-05-01 08:35:58 -05:00
fs_context.h smb: client: ensure aligned IO sizes 2025-05-01 08:35:58 -05:00
fscache.c cifs: Remove some code that's no longer used, part 1 2024-05-01 18:08:21 +01:00
fscache.h cifs: Remove some code that's no longer used, part 1 2024-05-01 18:08:21 +01:00
inode.c cifs: Split parse_reparse_point callback to functions: get buffer and parse buffer 2025-04-09 15:37:35 -05:00
ioctl.c convert cifs_ioctl_copychunk() 2024-11-03 01:28:07 -05:00
Kconfig smb: client: Deduplicate "select NETFS_SUPPORT" in Kconfig 2024-12-19 09:24:35 -06:00
link.c cifs: Fix querying and creating MF symlinks over SMB1 2025-04-01 01:54:17 -05:00
Makefile smb3: mark compression as CONFIG_EXPERIMENTAL and fix missing compression operation 2024-09-15 10:42:44 -05:00
misc.c cifs: Fix cifs_query_path_info() for Windows NT servers 2025-06-01 20:45:40 -05:00
namespace.c 13 smb3/cifs client fixes 2025-06-03 16:04:29 -07:00
netlink.c
netlink.h
netmisc.c cifs: Change translation of STATUS_PRIVILEGE_NOT_HELD to -EPERM 2025-01-29 16:52:25 -06:00
nterr.c cifs: Change translation of STATUS_NOT_A_REPARSE_POINT to -ENODATA 2025-01-26 23:12:03 -06:00
nterr.h cifs: Change translation of STATUS_NOT_A_REPARSE_POINT to -ENODATA 2025-01-26 23:12:03 -06:00
ntlmssp.h
readdir.c smb: improve directory cache reuse for readdir operations 2025-06-12 13:38:21 -05:00
reparse.c cifs: Split parse_reparse_point callback to functions: get buffer and parse buffer 2025-04-09 15:37:35 -05:00
reparse.h cifs: Split parse_reparse_point callback to functions: get buffer and parse buffer 2025-04-09 15:37:35 -05:00
rfc1002pdu.h cifs: Fix endian types in struct rfc1002_session_packet 2025-01-19 19:34:00 -06:00
sess.c cifs: update dstaddr whenever channel iface is updated 2025-06-02 13:34:27 -05:00
smb1ops.c smb: client: ensure aligned IO sizes 2025-05-01 08:35:58 -05:00
smb2file.c cifs: Do not add FILE_READ_ATTRIBUTES when using GENERIC_READ/EXECUTE/ALL 2025-04-01 04:58:09 -05:00
smb2glob.h cifs: Improve SMB2+ stat() to work also without FILE_READ_ATTRIBUTES 2025-04-01 04:58:05 -05:00
smb2inode.c smb3 client: warn when parse contexts returns error on compounded operation 2025-05-06 09:05:15 -05:00
smb2maperror.c cifs: Change translation of STATUS_PRIVILEGE_NOT_HELD to -EPERM 2025-01-29 16:52:25 -06:00
smb2misc.c cifs: avoid NULL pointer dereference in dbg call 2025-03-24 09:45:07 -05:00
smb2ops.c smb: client: make use of common smbdirect_socket_parameters 2025-06-03 18:42:47 -05:00
smb2pdu.c cifs: do not disable interface polling on failure 2025-06-03 18:42:48 -05:00
smb2pdu.h smb: client: correctly handle ErrorContextData as a flexible array 2025-01-19 19:34:00 -06:00
smb2proto.h smb: client: Remove an unused function and variable 2025-05-28 12:42:40 -05:00
smb2transport.c smb: client: fix use-after-free of signing key 2024-11-17 22:20:54 -06:00
smbdirect.c smb: client: make use of common smbdirect_socket_parameters 2025-06-03 18:42:47 -05:00
smbdirect.h smb: client: make use of common smbdirect_socket_parameters 2025-06-03 18:42:47 -05:00
smbencrypt.c smb: client: delete "true", "false" defines 2024-01-23 12:41:02 -06:00
smberr.h
trace.c
trace.h smb3: add missing tracepoint for querying wsl EAs 2025-01-19 19:34:00 -06:00
transport.c cifs: deal with the channel loading lag while picking channels 2025-06-03 18:42:47 -05:00
unc.c
winucase.c
xattr.c cifs: Add a new xattr system.smb3_ntsd_owner for getting or setting owner 2025-04-01 01:54:17 -05:00