linux/fs/smb/client
David Howells 100ccd18bb netfs: Optimise away reads above the point at which there can be no data
Track the file position above which the server is not expected to have any
data (the "zero point") and preemptively assume that we can satisfy
requests by filling them with zeroes locally rather than attempting to
download them if they're over that line - even if we've written data back
to the server.  Assume that any data that was written back above that
position is held in the local cache.  Note that we have to split requests
that straddle the line.

Make use of this to optimise away some reads from the server.  We need to
set the zero point in the following circumstances:

 (1) When we see an extant remote inode and have no cache for it, we set
     the zero_point to i_size.

 (2) On local inode creation, we set zero_point to 0.

 (3) On local truncation down, we reduce zero_point to the new i_size if
     the new i_size is lower.

 (4) On local truncation up, we don't change zero_point.

 (5) On local modification, we don't change zero_point.

 (6) On remote invalidation, we set zero_point to the new i_size.

 (7) If stored data is discarded from the pagecache or culled from fscache,
     we must set zero_point above that if the data also got written to the
     server.

 (8) If dirty data is written back to the server, but not fscache, we must
     set zero_point above that.

 (9) If a direct I/O write is made, set zero_point above that.

Assuming the above, any read from the server at or above the zero_point
position will return all zeroes.

The zero_point value can be stored in the cache, provided the above rules
are applied to it by any code that culls part of the local cache.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
2023-12-28 09:45:27 +00:00
..
asn1.c
cached_dir.c smb: client: fix potential OOBs in smb2_parse_contexts() 2023-12-11 12:30:39 -06:00
cached_dir.h smb: client: make laundromat a delayed worker 2023-10-12 09:41:04 -05:00
cifs_debug.c smb: client: fix potential OOB in cifs_dump_detail() 2023-12-17 19:03:08 -06:00
cifs_debug.h
cifs_fs_sb.h
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_negtokeninit.asn1
cifs_spnego.c cifs: spnego: add ';' in HOST_KEY_LEN 2023-11-13 16:21:34 -06:00
cifs_spnego.h
cifs_swn.c
cifs_swn.h
cifs_unicode.c fs/smb/client: Use common code in client 2023-08-30 08:55:52 -05:00
cifs_unicode.h fs/smb/client: Use common code in client 2023-08-30 08:55:52 -05:00
cifsacl.c
cifsacl.h
cifsencrypt.c
cifsfs.c netfs: Optimise away reads above the point at which there can be no data 2023-12-28 09:45:27 +00:00
cifsfs.h cifs: update internal module version number for cifs.ko 2023-11-10 09:33:26 -06:00
cifsglob.h smb: client: fix OOB in cifsd when receiving compounded resps 2023-12-17 19:00:12 -06:00
cifspdu.h smb: client, common: fix fortify warnings 2023-11-30 11:17:03 -06:00
cifsproto.h smb: client: introduce cifs_sfu_make_node() 2023-11-23 11:46:05 -06:00
cifsroot.c
cifssmb.c smb: client, common: fix fortify warnings 2023-11-30 11:17:03 -06:00
connect.c smb: client: fix OOB in cifsd when receiving compounded resps 2023-12-17 19:00:12 -06:00
dfs_cache.c smb: client: ensure to try all targets when finding nested links 2023-08-20 16:05:50 -05:00
dfs_cache.h smb: client: ensure to try all targets when finding nested links 2023-08-20 16:05:50 -05:00
dfs.c smb: client: fix mount when dns_resolver key is not available 2023-11-09 12:59:36 -06:00
dfs.h smb: client: get rid of dfs code dep in namespace.c 2023-08-20 16:05:50 -05:00
dir.c smb: client: get rid of dfs naming in automount code 2023-08-20 16:05:50 -05:00
dns_resolve.c
dns_resolve.h
export.c exportfs: make ->encode_fh() a mandatory method for NFS export 2023-10-28 16:15:15 +02:00
file.c netfs: Move pinning-for-writeback from fscache to netfs 2023-12-24 15:08:49 +00:00
fs_context.c fs/smb/client: Reset password pointer to NULL 2023-09-28 14:49:51 -05:00
fs_context.h smb: client: fix mount when dns_resolver key is not available 2023-11-09 12:59:36 -06:00
fscache.c netfs, cachefiles: Pass upper bound length to allow expansion 2023-12-28 09:45:25 +00:00
fscache.h client: convert to new timestamp accessors 2023-10-18 14:08:27 +02:00
inode.c smb: client: report correct st_size for SMB and NFS symlinks 2023-11-28 20:41:41 -06:00
ioctl.c Missing field not being returned in ioctl CIFS_IOC_GET_MNT_INFO 2023-11-10 09:32:04 -06:00
Kconfig fs/smb/client: Use common code in client 2023-08-30 08:55:52 -05:00
link.c smb: use crypto_shash_digest() in symlink_hash() 2023-10-31 12:38:26 -05:00
Makefile smb: client: get rid of dfs code dep in namespace.c 2023-08-20 16:05:50 -05:00
misc.c smb: client: fix OOB in smbCalcSize() 2023-12-17 19:02:59 -06:00
namespace.c smb: client: fix mount when dns_resolver key is not available 2023-11-09 12:59:36 -06:00
netlink.c
netlink.h
netmisc.c
nterr.c
nterr.h
ntlmssp.h cifs: Add client version details to NTLM authenticate message 2023-10-22 19:03:42 -05:00
readdir.c smb: client: set correct file type from NFS reparse points 2023-11-23 11:44:55 -06:00
rfc1002pdu.h
sess.c cifs: do not let cifs_chan_update_iface deallocate channels 2023-12-19 11:04:04 -06:00
smb1ops.c smb: client: introduce cifs_sfu_make_node() 2023-11-23 11:46:05 -06:00
smb2file.c
smb2glob.h
smb2inode.c smb: client: set correct file type from NFS reparse points 2023-11-23 11:44:55 -06:00
smb2maperror.c smb3: remove duplicate error mapping 2023-09-20 16:04:51 -05:00
smb2misc.c smb: client: fix potential OOB in smb2_dump_detail() 2023-12-19 10:33:39 -06:00
smb2ops.c smb: client: fix potential OOB in smb2_dump_detail() 2023-12-19 10:33:39 -06:00
smb2pdu.c cifs: fix a pending undercount of srv_count 2023-12-19 10:59:11 -06:00
smb2pdu.h smb: client, common: fix fortify warnings 2023-11-30 11:17:03 -06:00
smb2proto.h smb: client: fix potential OOBs in smb2_parse_contexts() 2023-12-11 12:30:39 -06:00
smb2status.h
smb2transport.c cifs: fix check of rc in function generate_smb3signingkey 2023-11-13 16:22:30 -06:00
smbdirect.c smb3: Add dynamic trace points for RDMA (smbdirect) reconnect 2023-09-19 11:03:24 -05:00
smbdirect.h
smbencrypt.c
smberr.h
trace.c
trace.h smb3: Add dynamic trace points for RDMA (smbdirect) reconnect 2023-09-19 11:03:24 -05:00
transport.c cifs: handle when server stops supporting multichannel 2023-11-10 09:33:19 -06:00
unc.c
winucase.c
xattr.c smb3: fix caching of ctime on setxattr 2023-11-09 10:25:58 -06:00