linux-stable/fs/cifs
Aurelien Aptel 352d96f3ac cifs: multichannel: move channel selection above transport layer
Move the channel (TCP_Server_Info*) selection from the tranport
layer to higher in the call stack so that:

- credit handling is done with the server that will actually be used
  to send.
  * ->wait_mtu_credit
  * ->set_credits / set_credits
  * ->add_credits / add_credits
  * add_credits_and_wake_if

- potential reconnection (smb2_reconnect) done when initializing a
  request is checked and done with the server that will actually be
  used to send.

To do this:

- remove the cifs_pick_channel() call out of compound_send_recv()

- select channel and pass it down by adding a cifs_pick_channel(ses)
  call in:
  - smb311_posix_mkdir
  - SMB2_open
  - SMB2_ioctl
  - __SMB2_close
  - query_info
  - SMB2_change_notify
  - SMB2_flush
  - smb2_async_readv  (if none provided in context param)
  - SMB2_read         (if none provided in context param)
  - smb2_async_writev (if none provided in context param)
  - SMB2_write        (if none provided in context param)
  - SMB2_query_directory
  - send_set_info
  - SMB2_oplock_break
  - SMB311_posix_qfs_info
  - SMB2_QFS_info
  - SMB2_QFS_attr
  - smb2_lockv
  - SMB2_lease_break
    - smb2_compound_op
  - smb2_set_ea
  - smb2_ioctl_query_info
  - smb2_query_dir_first
  - smb2_query_info_comound
  - smb2_query_symlink
  - cifs_writepages
  - cifs_write_from_iter
  - cifs_send_async_read
  - cifs_read
  - cifs_readpages

- add TCP_Server_Info *server param argument to:
  - cifs_send_recv
  - compound_send_recv
  - SMB2_open_init
  - SMB2_query_info_init
  - SMB2_set_info_init
  - SMB2_close_init
  - SMB2_ioctl_init
  - smb2_iotcl_req_init
  - SMB2_query_directory_init
  - SMB2_notify_init
  - SMB2_flush_init
  - build_qfs_info_req
  - smb2_hdr_assemble
  - smb2_reconnect
  - fill_small_buf
  - smb2_plain_req_init
  - __smb2_plain_req_init

The read/write codepath is different than the rest as it is using
pages, io iterators and async calls. To deal with those we add a
server pointer in the cifs_writedata/cifs_readdata/cifs_io_parms
context struct and set it in:

- cifs_writepages      (wdata)
- cifs_write_from_iter (wdata)
- cifs_readpages       (rdata)
- cifs_send_async_read (rdata)

The [rw]data->server pointer is eventually copied to
cifs_io_parms->server to pass it down to SMB2_read/SMB2_write.
If SMB2_read/SMB2_write is called from a different place that doesn't
set the server field it will pick a channel.

Some places do not pick a channel and just use ses->server or
cifs_ses_server(ses). All cifs_ses_server(ses) calls are in codepaths
involving negprot/sess.setup.

- SMB2_negotiate         (binding channel)
- SMB2_sess_alloc_buffer (binding channel)
- SMB2_echo              (uses provided one)
- SMB2_logoff            (uses master)
- SMB2_tdis              (uses master)

(list not exhaustive)

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2020-06-04 13:50:55 -05:00
..
asn1.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
cache.c
cifs_debug.c cifs: dump Security Type info in DebugData 2020-06-04 13:50:38 -05:00
cifs_debug.h cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
cifs_dfs_ref.c cifs: fix potential mismatch of UNC paths 2020-02-24 14:20:38 -06: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 cifs: add SMB3 change notification support 2020-02-06 09:14:28 -06:00
cifs_spnego.c cifs: switch servers depending on binding state 2019-11-25 01:16:30 -06:00
cifs_spnego.h
cifs_unicode.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07: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 fs/cifs: fix gcc warning in sid_to_id 2020-03-22 22:49:09 -05:00
cifsacl.h smb3: fix mode passed in on create for modetosid mount option 2019-12-06 14:15:52 -06:00
cifsencrypt.c cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
cifsfs.c smb3: Add new parm "nodelete" 2020-06-01 00:10:18 -05:00
cifsfs.h cifs: update internal module version number 2020-03-29 16:59:31 -05:00
cifsglob.h cifs: multichannel: move channel selection above transport layer 2020-06-04 13:50:55 -05:00
cifspdu.h cifs: cifspdu.h: Replace zero-length array with flexible-array member 2020-03-22 22:49:10 -05:00
cifsproto.h cifs: multichannel: move channel selection above transport layer 2020-06-04 13:50:55 -05:00
cifsroot.c cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
cifssmb.c cifs: minor fix to two debug messages 2020-06-01 00:10:18 -05:00
connect.c smb3: default to minimum of two channels when multichannel specified 2020-06-04 01:13:37 -05:00
dfs_cache.c cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
dfs_cache.h cifs: handle prefix paths in reconnect 2020-03-22 22:49:09 -05:00
dir.c cifs_atomic_open(): fix double-put on late allocation failure 2020-03-12 18:25:20 -04: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 cifs: multichannel: move channel selection above transport layer 2020-06-04 13:50:55 -05:00
fscache.c
fscache.h
inode.c cifs: multichannel: always zero struct cifs_io_parms 2020-06-04 13:50:55 -05:00
ioctl.c cifs: add SMB3 change notification support 2020-02-06 09:14:28 -06:00
Kconfig smb3: smbdirect support can be configured by default 2020-04-07 13:39:00 -05:00
link.c cifs: multichannel: move channel selection above transport layer 2020-06-04 13:50:55 -05:00
Makefile cifs: Add support for root file systems 2019-09-16 11:43:38 -05:00
misc.c cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
netmisc.c cifs: Standardize logging output 2020-06-01 00:10:18 -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 cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
rfc1002pdu.h
sess.c cifs: fix minor typos in comments and log messages 2020-06-02 09:58:30 -05:00
smb1ops.c cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
smb2file.c cifs: allow unlock flock and OFD lock across fork 2020-03-22 22:49:09 -05:00
smb2glob.h
smb2inode.c cifs: multichannel: move channel selection above transport layer 2020-06-04 13:50:55 -05:00
smb2maperror.c smb3: improve handling of share deleted (and share recreated) 2019-09-16 11:43:38 -05:00
smb2misc.c cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
smb2ops.c cifs: multichannel: move channel selection above transport layer 2020-06-04 13:50:55 -05:00
smb2pdu.c cifs: multichannel: move channel selection above transport layer 2020-06-04 13:50:55 -05:00
smb2pdu.h smb3: minor update to compression header definitions 2020-06-02 09:58:17 -05:00
smb2proto.h cifs: multichannel: move channel selection above transport layer 2020-06-04 13:50:55 -05:00
smb2status.h cifs: don't use __constant_cpu_to_le32() 2019-05-07 23:24:54 -05:00
smb2transport.c smb3: remove overly noisy debug line in signing errors 2020-04-16 12:23:40 -05:00
smbdirect.c cifs: Standardize logging output 2020-06-01 00:10:18 -05:00
smbdirect.h cifs: smbd: Do not schedule work to send immediate packet on every receive 2020-04-07 12:41:16 -05: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 smb3: Cleanup license mess 2019-01-24 09:37:33 -06:00
trace.h cifs: Add tracepoints for errors on flush or fsync 2020-02-05 18:24:19 -06:00
transport.c cifs: multichannel: move channel selection above transport layer 2020-06-04 13:50:55 -05:00
winucase.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
xattr.c CIFS: Add support for setting owner info, dos attributes, and create time 2020-01-26 19:24:17 -06:00