kernel_optimize_test/fs/cifs
Ronnie Sahlberg 5399e7b80c cifs: destage any unwritten data to the server before calling copychunk_write
[ Upstream commit f5d0f921ea362636e4a2efb7c38d1ead373a8700 ]

because the copychunk_write might cover a region of the file that has not yet
been sent to the server and thus fail.

A simple way to reproduce this is:
truncate -s 0 /mnt/testfile; strace -f -o x -ttT xfs_io -i -f -c 'pwrite 0k 128k' -c 'fcollapse 16k 24k' /mnt/testfile

the issue is that the 'pwrite 0k 128k' becomes rearranged on the wire with
the 'fcollapse 16k 24k' due to write-back caching.

fcollapse is implemented in cifs.ko as a SMB2 IOCTL(COPYCHUNK_WRITE) call
and it will fail serverside since the file is still 0b in size serverside
until the writes have been destaged.
To avoid this we must ensure that we destage any unwritten data to the
server before calling COPYCHUNK_WRITE.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1997373
Reported-by: Xiaoli Feng <xifeng@redhat.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-09 09:05:06 +02:00
..
asn1.c cifs: remove bogus debug code 2020-10-22 12:17:52 -05:00
cache.c
cifs_debug.c
cifs_debug.h
cifs_dfs_ref.c cifs: prevent NULL deref in cifs_compose_mount_options() 2021-07-25 14:36:17 +02:00
cifs_fs_sb.h
cifs_ioctl.h
cifs_spnego.c
cifs_spnego.h
cifs_unicode.c CIFS: Fix a potencially linear read overflow 2021-09-15 09:50:43 +02:00
cifs_unicode.h
cifs_uniupr.h
cifsacl.c cifs: fix a memleak with modefromsid 2020-11-15 23:05:33 -06:00
cifsacl.h
cifsencrypt.c
cifsfs.c cifs: Check the IOCB_DIRECT flag, not O_DIRECT 2022-04-27 13:53:53 +02:00
cifsfs.h cifs: update internal module version number 2020-10-23 23:41:49 -05:00
cifsglob.h cifs: fix missing spinlock around update to ses->status 2021-07-14 16:56:01 +02:00
cifspdu.h cifs: Adjust key sizes and key generation routines for AES256 encryption 2021-03-30 14:32:07 +02:00
cifsproto.h SMB3.1.1: Fix ids returned in POSIX query dir 2020-10-20 11:51:24 -05:00
cifsroot.c
cifssmb.c
connect.c cifs: fix incorrect check for null pointer in header_assemble 2021-09-30 10:10:59 +02:00
dfs_cache.c cifs: check pointer before freeing 2021-01-19 18:27:19 +01:00
dfs_cache.h
dir.c cifs: report error instead of invalid when revalidating a dentry fails 2021-02-10 09:29:17 +01:00
dns_resolve.c
dns_resolve.h
export.c
file.c smb3: do not error on fsync when readonly 2021-12-01 09:19:08 +01:00
fs_context.c cifs: move smb version mount options into fs_context.c 2020-10-22 12:17:31 -05:00
fs_context.h cifs: move smb version mount options into fs_context.c 2020-10-22 12:17:31 -05:00
fscache.c
fscache.h
inode.c new helper: inode_wrong_type() 2021-09-08 08:49:01 +02:00
ioctl.c
Kconfig
link.c cifs: potential buffer overflow in handling symlinks 2022-04-20 09:23:18 +02:00
Makefile cifs: add files to host new mount api 2020-10-22 12:16:24 -05:00
misc.c
netmisc.c
nterr.c
nterr.h
ntlmssp.h
readdir.c SMB3: add support for recognizing WSL reparse tags 2020-10-22 12:17:59 -05:00
rfc1002pdu.h
sess.c cifs: fix wrong release in sess_alloc_buffer() failed path 2021-09-18 13:40:32 +02:00
smb1ops.c
smb2file.c
smb2glob.h cifs: Adjust key sizes and key generation routines for AES256 encryption 2021-03-30 14:32:07 +02:00
smb2inode.c cifs: do not send close in compound create+close requests 2021-03-17 17:06:28 +01:00
smb2maperror.c
smb2misc.c cifs: Silently ignore unknown oplock break handle 2021-04-10 13:36:10 +02:00
smb2ops.c cifs: destage any unwritten data to the server before calling copychunk_write 2022-05-09 09:05:06 +02:00
smb2pdu.c smb3: correct smb3 ACL security descriptor 2021-10-09 14:40:57 +02:00
smb2pdu.h smb3: Fix out-of-bounds bug in SMB2_negotiate() 2021-02-10 09:29:17 +01:00
smb2proto.h cifs: do not send close in compound create+close requests 2021-03-17 17:06:28 +01:00
smb2status.h
smb2transport.c cifs: Adjust key sizes and key generation routines for AES256 encryption 2021-03-30 14:32:07 +02:00
smbdirect.c
smbdirect.h
smbencrypt.c
smberr.h
smbfsctl.h smb3: add some missing definitions from MS-FSCC 2020-10-23 15:38:10 -05:00
trace.c
trace.h smb3: add dynamic trace point to trace when credits obtained 2020-10-20 11:50:42 -05:00
transport.c cifs: change noisy error message to FYI 2021-03-30 14:31:50 +02:00
winucase.c
xattr.c