1. 19 5月, 2021 1 次提交
  2. 08 5月, 2021 1 次提交
  3. 26 4月, 2021 1 次提交
  4. 07 3月, 2021 1 次提交
  5. 17 2月, 2021 1 次提交
  6. 16 2月, 2021 1 次提交
  7. 14 1月, 2021 1 次提交
  8. 19 12月, 2020 2 次提交
  9. 14 12月, 2020 1 次提交
  10. 04 12月, 2020 1 次提交
  11. 21 10月, 2020 1 次提交
  12. 20 10月, 2020 2 次提交
  13. 16 10月, 2020 2 次提交
  14. 24 8月, 2020 1 次提交
  15. 11 8月, 2020 1 次提交
  16. 03 8月, 2020 2 次提交
  17. 13 6月, 2020 2 次提交
  18. 12 6月, 2020 2 次提交
  19. 05 6月, 2020 3 次提交
    • A
      cifs: multichannel: try to rebind when reconnecting a channel · 2f589679
      Aurelien Aptel 提交于
      first steps in trying to make channels properly reconnect.
      
      * add cifs_ses_find_chan() function to find the enclosing cifs_chan
        struct it belongs to
      * while we have the session lock and are redoing negprot and
        sess.setup in smb2_reconnect() redo the binding of channels.
      Signed-off-by: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      2f589679
    • S
      smb3: remove static checker warning · edb16135
      Steve French 提交于
      Remove static checker warning pointed out by Dan Carpenter:
      
      The patch feeaec621c09: "cifs: multichannel: move channel selection
      above transport layer" from Apr 24, 2020, leads to the following
      static checker warning:
      
              fs/cifs/smb2pdu.c:149 smb2_hdr_assemble()
              error: we previously assumed 'tcon->ses' could be null (see line 133)
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      CC: Aurelien Aptel <aptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      edb16135
    • A
      cifs: multichannel: move channel selection above transport layer · 352d96f3
      Aurelien Aptel 提交于
      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: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      352d96f3
  20. 04 6月, 2020 1 次提交
  21. 01 6月, 2020 3 次提交
    • S
      cifs: minor fix to two debug messages · adbb2daf
      Steve French 提交于
      Joe Perches pointed out that we were missing a newline
      at the end of two debug messages
      Reported-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      adbb2daf
    • J
      cifs: Standardize logging output · a0a3036b
      Joe Perches 提交于
      Use pr_fmt to standardize all logging for fs/cifs.
      
      Some logging output had no CIFS: specific prefix.
      
      Now all output has one of three prefixes:
      
      o CIFS:
      o CIFS: VFS:
      o Root-CIFS:
      
      Miscellanea:
      
      o Convert printks to pr_<level>
      o Neaten macro definitions
      o Remove embedded CIFS: prefixes from formats
      o Convert "illegal" to "invalid"
      o Coalesce formats
      o Add missing '\n' format terminations
      o Consolidate multiple cifs_dbg continuations into single calls
      o More consistent use of upper case first word output logging
      o Multiline statement argument alignment and wrapping
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      a0a3036b
    • P
      cifs: handle hostnames that resolve to same ip in failover · e4af35fa
      Paulo Alcantara 提交于
      In order to support reconnect to hostnames that resolve to same ip
      address, besides relying on the currently set hostname to match DFS
      targets, attempt to resolve the targets and then match their addresses
      with the reconnected server ip address.
      
      For instance, if we have two hostnames "FOO" and "BAR", and both
      resolve to the same ip address, we would be able to handle failover in
      DFS paths like
      
          \\FOO\dfs\link1 -> [ \BAZ\share2 (*), \BAR\share1 ]
          \\FOO\dfs\link2 -> [ \BAZ\share2 (*), \FOO\share1 ]
      
      so when "BAZ" is no longer accessible, link1 and link2 would get
      reconnected despite having different target hostnames.
      Signed-off-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      e4af35fa
  22. 16 4月, 2020 1 次提交
  23. 23 3月, 2020 6 次提交
  24. 25 2月, 2020 1 次提交
    • A
      cifs: fix rename() by ensuring source handle opened with DELETE bit · 86f740f2
      Aurelien Aptel 提交于
      To rename a file in SMB2 we open it with the DELETE access and do a
      special SetInfo on it. If the handle is missing the DELETE bit the
      server will fail the SetInfo with STATUS_ACCESS_DENIED.
      
      We currently try to reuse any existing opened handle we have with
      cifs_get_writable_path(). That function looks for handles with WRITE
      access but doesn't check for DELETE, making rename() fail if it finds
      a handle to reuse. Simple reproducer below.
      
      To select handles with the DELETE bit, this patch adds a flag argument
      to cifs_get_writable_path() and find_writable_file() and the existing
      'bool fsuid_only' argument is converted to a flag.
      
      The cifsFileInfo struct only stores the UNIX open mode but not the
      original SMB access flags. Since the DELETE bit is not mapped in that
      mode, this patch stores the access mask in cifs_fid on file open,
      which is accessible from cifsFileInfo.
      
      Simple reproducer:
      
      	#include <stdio.h>
      	#include <stdlib.h>
      	#include <sys/types.h>
      	#include <sys/stat.h>
      	#include <fcntl.h>
      	#include <unistd.h>
      	#define E(s) perror(s), exit(1)
      
      	int main(int argc, char *argv[])
      	{
      		int fd, ret;
      		if (argc != 3) {
      			fprintf(stderr, "Usage: %s A B\n"
      			"create&open A in write mode, "
      			"rename A to B, close A\n", argv[0]);
      			return 0;
      		}
      
      		fd = openat(AT_FDCWD, argv[1], O_WRONLY|O_CREAT|O_SYNC, 0666);
      		if (fd == -1) E("openat()");
      
      		ret = rename(argv[1], argv[2]);
      		if (ret) E("rename()");
      
      		ret = close(fd);
      		if (ret) E("close()");
      
      		return ret;
      	}
      
      $ gcc -o bugrename bugrename.c
      $ ./bugrename /mnt/a /mnt/b
      rename(): Permission denied
      
      Fixes: 8de9e86c ("cifs: create a helper to find a writeable handle by path name")
      CC: Stable <stable@vger.kernel.org>
      Signed-off-by: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      Reviewed-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      86f740f2
  25. 07 2月, 2020 1 次提交