linux-stable/fs/smb/client
Meetakshi Setiya 2c7d399e55 smb: client: reuse file lease key in compound operations
Currently, when a rename, unlink or set path size compound operation
is requested on a file that has a lot of dirty pages to be written
to the server, we do not send the lease key for these requests. As a
result, the server can assume that this request is from a new client, and
send a lease break notification to the same client, on the same
connection. As a response to the lease break, the client can consume
several credits to write the dirty pages to the server. Depending on the
server's credit grant implementation, the server can stop granting more
credits to this connection, and this can cause a deadlock (which can only
be resolved when the lease timer on the server expires).
One of the problems here is that the client is sending no lease key,
even if it has a lease for the file. This patch fixes the problem by
reusing the existing lease key on the file for rename, unlink and set path
size compound operations so that the client does not break its own lease.

A very trivial example could be a set of commands by a client that
maintains open handle (for write) to a file and then tries to copy the
contents of that file to another one, eg.,

tail -f /dev/null > myfile &
mv myfile myfile2

Presently, the network capture on the client shows that the move (or
rename) would trigger a lease break on the same client, for the same file.
With the lease key reused, the lease break request-response overhead is
eliminated, thereby reducing the roundtrips performed for this set of
operations.

The patch fixes the bug described above and also provides perf benefit.

Signed-off-by: Meetakshi Setiya <msetiya@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2024-03-10 19:33:54 -05:00
..
asn1.c
cached_dir.c cifs: update the same create_guid on replay 2024-02-11 19:07:08 -06:00
cached_dir.h smb: client: make laundromat a delayed worker 2023-10-12 09:41:04 -05:00
cifs_debug.c cifs: allow changing password during remount 2024-03-10 19:33:53 -05: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.c cifs: spnego: add ';' in HOST_KEY_LEN 2023-11-13 16:21:34 -06:00
cifs_spnego.h
cifs_spnego_negtokeninit.asn1
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 smb: Work around Clang __bdos() type confusion 2024-01-23 18:56:16 -06:00
cifsfs.c smb: remove SLAB_MEM_SPREAD flag usage 2024-03-10 19:33:53 -05:00
cifsfs.h cifs: update internal module version number for cifs.ko 2024-01-09 23:42:51 -06:00
cifsglob.h smb: client: reuse file lease key in compound operations 2024-03-10 19:33:54 -05:00
cifspdu.h smb: client, common: fix fortify warnings 2023-11-30 11:17:03 -06:00
cifsproto.h smb: client: reuse file lease key in compound operations 2024-03-10 19:33:54 -05:00
cifsroot.c
cifssmb.c smb: client: reuse file lease key in compound operations 2024-03-10 19:33:54 -05:00
connect.c smb: Fix regression in writes when non-standard maximum write size negotiated 2024-02-15 22:19:23 -06:00
dfs.c cifs: change tcon status when need_reconnect is set on it 2024-02-09 14:43:23 -06:00
dfs.h smb: client: get rid of dfs code dep in namespace.c 2023-08-20 16:05:50 -05: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
dir.c smb: client: allow creating special files via reparse points 2024-01-07 15:46:05 -06: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 smb3: update allocation size more accurately on write completion 2024-03-10 19:33:54 -05:00
fs_context.c cifs: allow changing password during remount 2024-03-10 19:33:53 -05:00
fs_context.h cifs: new mount option called retrans 2024-01-19 10:31:57 -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: reuse file lease key in compound operations 2024-03-10 19:33:54 -05: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: client: allow creating symlinks via reparse points 2024-01-07 15:46:06 -06:00
Makefile smb: client: get rid of dfs code dep in namespace.c 2023-08-20 16:05:50 -05:00
misc.c smb3: show beginning time for per share stats 2024-01-18 12:07:51 -06:00
namespace.c smb: client: set correct id, uid and cruid for multiuser automounts 2024-02-12 12:46:49 -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 cifs: prevent updating file size from server if we have a read/write lease 2024-03-10 19:33:53 -05:00
rfc1002pdu.h
sess.c cifs: handle cases where multiple sessions share connection 2024-02-09 14:43:25 -06:00
smb1ops.c smb: client: introduce cifs_sfu_make_node() 2023-11-23 11:46:05 -06:00
smb2file.c
smb2glob.h smb: client: optimise reparse point querying 2024-01-07 15:46:05 -06:00
smb2inode.c smb: client: reuse file lease key in compound operations 2024-03-10 19:33:54 -05:00
smb2maperror.c cifs: new nt status codes from MS-SMB2 2024-01-18 21:01:04 -06:00
smb2misc.c smb: client: fix potential OOB in smb2_dump_detail() 2023-12-19 10:33:39 -06:00
smb2ops.c smb: client: handle path separator of created SMB symlinks 2024-02-12 12:47:21 -06:00
smb2pdu.c cifs: allow changing password during remount 2024-03-10 19:33:53 -05:00
smb2pdu.h smb: client, common: fix fortify warnings 2023-11-30 11:17:03 -06:00
smb2proto.h smb: client: reuse file lease key in compound operations 2024-03-10 19:33:54 -05:00
smb2status.h cifs: new nt status codes from MS-SMB2 2024-01-18 21:01:04 -06:00
smb2transport.c cifs: fix check of rc in function generate_smb3signingkey 2023-11-13 16:22:30 -06:00
smbdirect.c smb3: Improve exception handling in allocate_mr_list() 2024-01-07 15:46:06 -06:00
smbdirect.h
smbencrypt.c smb: client: delete "true", "false" defines 2024-01-23 12:41:02 -06:00
smberr.h
trace.c
trace.h smb: client: optimise reparse point querying 2024-01-07 15:46:05 -06:00
transport.c smb: client: increase number of PDUs allowed in a compound request 2024-02-01 12:15:51 -06:00
unc.c
winucase.c
xattr.c smb3: fix caching of ctime on setxattr 2023-11-09 10:25:58 -06:00