linux-brain/fs/cifs
Pavel Shilovsky d77d3f94ce CIFS: Fix read after write for files with read caching
commit 6dfbd84684 upstream.

When we have a READ lease for a file and have just issued a write
operation to the server we need to purge the cache and set oplock/lease
level to NONE to avoid reading stale data. Currently we do that
only if a write operation succedeed thus not covering cases when
a request was sent to the server but a negative error code was
returned later for some other reasons (e.g. -EIOCBQUEUED or -EINTR).
Fix this by turning off caching regardless of the error code being
returned.

The patches fixes generic tests 075 and 112 from the xfs-tests.

Cc: <stable@vger.kernel.org>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-23 14:35:18 +01:00
..
asn1.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
cache.c fscache: remove unused ->now_uncached callback 2017-09-06 17:27:26 -07:00
cifs_debug.c smb3: allow stats which track session and share reconnects to be reset 2018-11-13 11:15:09 -08:00
cifs_debug.h lib: update single-char callers of strtobool() 2016-03-17 15:09:34 -07:00
cifs_dfs_ref.c CIFS: add build_path_from_dentry_optional_prefix() 2017-03-01 22:26:10 -06:00
cifs_fs_sb.h cifs: Convert to separately allocated bdi 2017-04-20 12:09:55 -06:00
cifs_ioctl.h Enable previous version support 2016-10-13 19:48:11 -05:00
cifs_spnego.c smb3: on kerberos mount if server doesn't specify auth type use krb5 2018-11-13 11:15:09 -08:00
cifs_spnego.h [CIFS] Rename three structures to avoid camel case 2011-05-27 04:34:02 +00:00
cifs_unicode.c fs/cifs: don't translate SFM_SLASH (U+F026) to backslash 2018-10-10 08:54:21 +02:00
cifs_unicode.h [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
cifs_uniupr.h cifs: correction of unicode header files 2010-08-20 00:46:42 +00:00
cifsacl.c cifs: cifsacl: Use a temporary ops variable to reduce code length 2017-05-12 19:45:18 -05:00
cifsacl.h cifs: For SMB2 security informaion query, check for minimum sized security descriptor instead of sizeof FileAllInformation class 2018-06-26 08:06:31 +08:00
cifsencrypt.c CIFS: fix sha512 check in cifs_crypto_secmech_release 2018-04-24 09:36:27 +02:00
cifsfs.c cifs: don't dereference smb_file_target before null check 2018-11-27 16:10:46 +01:00
cifsfs.h Update version of cifs module 2017-09-17 23:10:48 -05:00
cifsglob.h cifs: Fix use after free of a mid_q_entry 2018-07-11 16:29:15 +02:00
cifspdu.h CIFS: move DFS response parsing out of SMB1 code 2017-03-01 22:26:10 -06:00
cifsproto.h cifs: Fix use after free of a mid_q_entry 2018-07-11 16:29:15 +02:00
cifssmb.c CIFS: Fix credits calculations for reads with errors 2019-01-31 08:13:44 +01:00
connect.c cifs: Always resolve hostname before reconnecting 2019-02-06 17:31:37 +01:00
dir.c cifs: Fix separator when building path from dentry 2018-12-13 09:18:53 +01:00
dns_resolve.c cifs: fix composing of mount options for DFS referrals 2013-05-24 13:08:31 -05:00
dns_resolve.h DNS: Separate out CIFS DNS Resolver code 2010-08-05 17:17:51 +00:00
export.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
file.c CIFS: Fix read after write for files with read caching 2019-03-23 14:35:18 +01:00
fscache.c NFS client updates for Linux 3.13 2013-11-08 05:57:46 +09:00
fscache.h CIFS: FS-Cache: Uncache unread pages in cifs_readpages() before freeing them 2013-09-18 10:17:03 -05:00
inode.c smb3: do not attempt cifs operation in smb3 query info error path 2018-11-13 11:15:09 -08:00
ioctl.c [SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred 2017-07-08 18:57:07 -05:00
Kconfig cifs: allow disabling insecure dialects in the config 2019-01-26 09:37:07 +01:00
link.c smb3: don't request leases in symlink creation and query 2018-09-05 09:26:33 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
misc.c cifs: read overflow in is_valid_oplock_break() 2018-10-10 08:54:26 +02:00
netmisc.c cifs: small underflow in cnvrtDosUnixTm() 2017-05-02 14:57:34 -05:00
nterr.c CIFS: Rename 7 error codes to NT_ style 2012-07-24 10:25:10 -05:00
nterr.h CIFS: Rename 7 error codes to NT_ style 2012-07-24 10:25:10 -05:00
ntlmssp.h cifs: dynamic allocation of ntlmssp blob 2016-06-23 23:45:07 -05:00
readdir.c cifs: check ntwrk_buf_start for NULL before dereferencing it 2019-02-12 19:46:08 +01:00
rfc1002pdu.h
sess.c cifs: check kmalloc before use 2018-09-05 09:26:33 +02:00
smb1ops.c cifs: Fix use after free of a mid_q_entry 2018-07-11 16:29:15 +02:00
smb2file.c cifs: Limit memory used by lock request calls to a page 2019-02-20 10:20:51 +01:00
smb2glob.h CIFS: Separate SMB2 header structure 2017-02-01 16:46:34 -06:00
smb2inode.c smb3: Do not send SMB3 SET_INFO if nothing changed 2018-09-05 09:26:33 +02:00
smb2maperror.c CIFS: Fix error mapping for SMB2_LOCK command which caused OFD lock problem 2019-01-09 17:14:52 +01:00
smb2misc.c CIFS: Do not reset lease state to NONE on lease break 2019-03-23 14:35:18 +01:00
smb2ops.c CIFS: Do not reset lease state to NONE on lease break 2019-03-23 14:35:18 +01:00
smb2pdu.c CIFS: Do not count -ENODATA as failure for query directory 2019-02-06 17:31:34 +01:00
smb2pdu.h cifs: fix computation for MAX_SMB2_HDR_SIZE 2019-03-13 14:03:15 -07:00
smb2proto.h CIFS: add sha512 secmech 2018-04-24 09:36:27 +02:00
smb2status.h CIFS: Add SMB2 status codes 2012-07-24 10:25:13 -05:00
smb2transport.c cifs: Fix use after free of a mid_q_entry 2018-07-11 16:29:15 +02:00
smbencrypt.c CIFS: refactor crypto shash/sdesc allocation&free 2018-04-24 09:36:27 +02:00
smberr.h cifs: map NT_STATUS_ERROR_WRITE_PROTECTED to -EROFS 2010-08-02 12:40:40 +00:00
smbfsctl.h [SMB3] Send durable handle v2 contexts when use of persistent handles required 2015-11-03 09:26:27 -06:00
transport.c CIFS: Do not hide EINTR after sending network packets 2019-01-16 22:07:10 +01:00
winucase.c [CIFS] quiet sparse compile warning 2013-09-08 14:54:24 -05:00
xattr.c cifs: Add support for writing attributes on SMB2+ 2017-09-04 14:03:45 -05:00