linux-stable/fs/cifs
Ronnie Sahlberg a827521975 cifs: destage any unwritten data to the server before calling copychunk_write
[ Upstream commit f5d0f921ea ]

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:03:26 +02:00
..
asn1.c cifs: remove bogus debug code 2020-10-29 09:57:28 +01:00
cache.c
cifs_debug.c cifs: Don't display RDMA transport on reconnect 2019-12-21 11:04:43 +01:00
cifs_debug.h cifs: add a debug macro that prints \\server\share for errors 2019-09-16 11:43:38 -05:00
cifs_dfs_ref.c cifs: prevent NULL deref in cifs_compose_mount_options() 2021-07-25 14:35:13 +02:00
cifs_fs_sb.h smb3: add mount option to allow RW caching of share accessed by only 1 client 2019-09-16 11:43:38 -05:00
cifs_ioctl.h smb3: allow decryption keys to be dumped by admin for debugging 2019-09-21 06:02:26 -05:00
cifs_spnego.c Revert "Merge tag 'keys-acl-20190703' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs" 2019-07-10 18:43:43 -07:00
cifs_spnego.h
cifs_unicode.c CIFS: Fix a potencially linear read overflow 2021-09-15 09:47:36 +02:00
cifs_unicode.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
cifs_uniupr.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
cifsacl.c cifs: fix a memleak with modefromsid 2020-12-02 08:49:45 +01:00
cifsacl.h smb3: missing ACL related flags 2019-09-26 16:37:43 -05:00
cifsencrypt.c fs: cifs: switch to RC4 library interface 2019-06-20 14:19:55 +08:00
cifsfs.c cifs: Check the IOCB_DIRECT flag, not O_DIRECT 2022-04-27 13:50:47 +02:00
cifsfs.h cifs: update internal module version number 2019-09-16 19:18:39 -05:00
cifsglob.h cifs: fix missing spinlock around update to ses->status 2021-07-14 16:53:19 +02:00
cifspdu.h
cifsproto.h cifs: fix rename() by ensuring source handle opened with DELETE bit 2020-03-12 13:00:18 +01:00
cifsroot.c cifs: cifsroot: add more err checking 2019-09-16 11:43:39 -05:00
cifssmb.c cifs: fix leaked reference on requeued write 2020-05-20 08:20:34 +02:00
connect.c cifs: fix incorrect check for null pointer in header_assemble 2021-09-30 10:09:21 +02:00
dfs_cache.c cifs: fix unitialized variable poential problem with network I/O cache lock patch 2020-02-24 08:36:58 +01:00
dfs_cache.h cifs: Fix DFS cache refresher for DFS links 2019-05-07 23:24:54 -05:00
dir.c cifs: report error instead of invalid when revalidating a dentry fails 2021-02-10 09:25:30 +01:00
dns_resolve.c keys: Pass the network namespace into request_key mechanism 2019-06-27 23:02:12 +01:00
dns_resolve.h
export.c docs: fs: convert docs without extension to ReST 2019-07-31 13:31:05 -06:00
file.c smb3: do not error on fsync when readonly 2021-12-01 09:23:34 +01:00
fscache.c
fscache.h
inode.c cifs: handle -EINTR in cifs_setattr 2020-11-05 11:43:21 +01:00
ioctl.c smb3: allow decryption keys to be dumped by admin for debugging 2019-09-21 06:02:26 -05:00
Kconfig various cifs/smb3 fixes (including for share deleted cases) and features including improved encrypted read performance, and various debugging improvements 2019-09-19 10:32:16 -07:00
link.c cifs: potential buffer overflow in handling symlinks 2022-04-20 09:19:36 +02:00
Makefile cifs: Add support for root file systems 2019-09-16 11:43:38 -05:00
misc.c CIFS: Properly process SMB3 lease breaks 2020-10-01 13:17:21 +02:00
netmisc.c fs: cifs: mute -Wunused-const-variable message 2019-10-06 22:04:35 -05:00
nterr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
nterr.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
ntlmssp.h
readdir.c
rfc1002pdu.h
sess.c cifs: fix wrong release in sess_alloc_buffer() failed path 2021-09-22 12:26:35 +02:00
smb1ops.c CIFS: Properly process SMB3 lease breaks 2020-10-01 13:17:21 +02:00
smb2file.c cifs: Adjust indentation in smb2_open_file 2020-01-17 19:48:27 +01:00
smb2glob.h
smb2inode.c cifs: fix rename() by ensuring source handle opened with DELETE bit 2020-03-12 13:00:18 +01:00
smb2maperror.c smb3: improve handling of share deleted (and share recreated) 2019-09-16 11:43:38 -05:00
smb2misc.c cifs: Silently ignore unknown oplock break handle 2021-04-10 13:34:31 +02:00
smb2ops.c cifs: destage any unwritten data to the server before calling copychunk_write 2022-05-09 09:03:26 +02:00
smb2pdu.c SMB3: incorrect file id in requests compounded with open 2021-06-03 08:59:12 +02:00
smb2pdu.h smb3: Fix out-of-bounds bug in SMB2_negotiate() 2021-02-10 09:25:30 +01:00
smb2proto.h smb3: remove unused flag passed into close functions 2021-01-19 18:26:13 +01:00
smb2status.h cifs: don't use __constant_cpu_to_le32() 2019-05-07 23:24:54 -05:00
smb2transport.c CIFS: Fix task struct use-after-free on reconnect 2020-02-01 09:34:37 +00:00
smbdirect.c cifs: smbd: Return -ECONNABORTED when trasnport is not in connected state 2019-12-21 11:04:43 +01:00
smbdirect.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
smbencrypt.c fs: cifs: move from the crypto cipher API to the new DES library interface 2019-08-22 14:57:34 +10:00
smberr.h
smbfsctl.h smb3: Add missing reparse tags 2019-09-24 23:31:32 -05:00
trace.c
trace.h smb3: add missing worker function for SMB3 change notify 2019-09-16 11:43:39 -05:00
transport.c cifs: change noisy error message to FYI 2021-03-30 14:35:21 +02:00
winucase.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
xattr.c CIFS: fix max ea value size 2019-09-23 23:28:59 -05:00