1. 20 1月, 2014 3 次提交
  2. 28 12月, 2013 3 次提交
  3. 25 11月, 2013 1 次提交
    • S
      [CIFS] Do not use btrfs refcopy ioctl for SMB2 copy offload · f19e84df
      Steve French 提交于
      Change cifs.ko to using CIFS_IOCTL_COPYCHUNK instead
      of BTRFS_IOC_CLONE to avoid confusion about whether
      copy-on-write is required or optional for this operation.
      
      SMB2/SMB3 copyoffload had used the BTRFS_IOC_CLONE ioctl since
      they both speed up copy by offloading the copy rather than
      passing many read and write requests back and forth and both have
      identical syntax (passing file handles), but for SMB2/SMB3
      CopyChunk the server is not required to use copy-on-write
      to make a copy of the file (although some do), and Christoph
      has commented that since CopyChunk does not require
      copy-on-write we should not reuse BTRFS_IOC_CLONE.
      
      This patch renames the ioctl to use a cifs specific IOCTL
      CIFS_IOCTL_COPYCHUNK.  This ioctl is particularly important
      for SMB2/SMB3 since large file copy over the network otherwise
      can be very slow, and with this is often more than 100 times
      faster putting less load on server and client.
      
      Note that if a copy syscall is ever introduced, depending on
      its requirements/format it could end up using one of the other
      three methods that CIFS/SMB2/SMB3 can do for copy offload,
      but this method is particularly useful for file copy
      and broadly supported (not just by Samba server).
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NDavid Disseldorp <ddiss@samba.org>
      f19e84df
  4. 20 11月, 2013 1 次提交
  5. 19 11月, 2013 2 次提交
  6. 16 11月, 2013 3 次提交
    • S
      [CIFS] Warn if SMB3 encryption required by server · 0cbaa53c
      Steve French 提交于
      We do not support SMB3 encryption yet, warn if server responds
      that SMB3 encryption is mandatory.
      Signed-off-by: NSteve French <smfrench@gmail.com>
      0cbaa53c
    • S
      setfacl removes part of ACL when setting POSIX ACLs to Samba · b1d93356
      Steve French 提交于
      setfacl over cifs mounts can remove the default ACL when setting the
      (non-default part of) the ACL and vice versa (we were leaving at 0
      rather than setting to -1 the count field for the unaffected
      half of the ACL.  For example notice the setfacl removed
      the default ACL in this sequence:
      
      steven@steven-GA-970A-DS3:~/cifs-2.6$ getfacl /mnt/test-dir ; setfacl
      -m default:user:test:rwx,user:test:rwx /mnt/test-dir
      getfacl: Removing leading '/' from absolute path names
      user::rwx
      group::r-x
      other::r-x
      default:user::rwx
      default:user:test:rwx
      default:group::r-x
      default:mask::rwx
      default:other::r-x
      
      steven@steven-GA-970A-DS3:~/cifs-2.6$ getfacl /mnt/test-dir
      getfacl: Removing leading '/' from absolute path names
      user::rwx
      user:test:rwx
      group::r-x
      mask::rwx
      other::r-x
      
      CC: Stable <stable@kernel.org>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Acked-by: NJeremy Allison <jra@samba.org>
      b1d93356
    • S
      [CIFS] Set copychunk defaults · de9f68df
      Steve French 提交于
      Patch 2 of the copy chunk series (the final patch will
      use these to handle copies of files larger than the chunk size.
      
      We set the same defaults that Windows and Samba expect for
      CopyChunk.
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Reviewed-by: NDavid Disseldorp <ddiss@samba.org>
      de9f68df
  7. 14 11月, 2013 1 次提交
    • S
      CIFS: SMB2/SMB3 Copy offload support (refcopy) phase 1 · 41c1358e
      Steve French 提交于
      This first patch adds the ability for us to do a server side copy
      (ie fast copy offloaded to the server to perform, aka refcopy)
      
      "cp --reflink"
      
      of one file to another located on the same server.  This
      is much faster than traditional copy (which requires
      reading and writing over the network and extra
      memcpys).
      
      This first version is not going to be copy
      files larger than about 1MB (to Samba) until I add
      support for multiple chunks and for autoconfiguring
      the chunksize.
      
      It includes:
      1) processing of the ioctl
      2) marshalling and sending the SMB2/SMB3 fsctl over the network
      3) simple parsing of the response
      
      It does not include yet (these will be in followon patches to come soon):
      1) support for multiple chunks
      2) support for autoconfiguring and remembering the chunksize
      3) Support for the older style copychunk which Samba 4.1 server supports
      (because this requires write permission on the target file, which
      cp does not give you, apparently per-posix).  This may require
      a distinct tool (other than cp) and other ioctl to implement.
      Reviewed-by: NPavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      41c1358e
  8. 12 11月, 2013 5 次提交
  9. 03 11月, 2013 7 次提交
    • S
      Query network adapter info at mount time for debugging · c481e9fe
      Steve French 提交于
      When CONFIG_CIFS_STATS2 enabled query adapter info for debugging
      
      It is easy now in SMB3 to query the information about the server's
      network interfaces (and at least Windows 8 and above do this, if not
      other clients) there are some useful pieces of information you can get
      including:
      
      - all of the network interfaces that the server advertises (not just
      the one you are mounting over), and with SMB3 supporting multichannel
      this helps with more than just failover (also aggregating multiple
      sockets under one mount)
      
      - whether the adapter supports RSS (useful to know if you want to
      estimate whether setting up two or more socket connections to the same
      address is going to be faster due to RSS offload in the adapter)
      
      - whether the server supports RDMA
      
      - whether the server has IPv6 interfaces (if you connected over IPv4
      but prefer IPv6 e.g.)
      
      - what the link speed is (you might want to reconnect over a higher
      speed interface if available)
      
      (Of course we could also rerequest this on every mount cheaplly to the
      same server, as Windows apparently does, so we can update the adapter
      info on new mounts, and also on every reconnect if the network
      interface drops temporarily - so we don't have to rely on info from
      the first mount to this server)
      
      It is trivial to request this information - and certainly will be useful
      when we get to the point of doing multichannel (and eventually RDMA),
      but some of this (linkspeed etc.) info may help for debugging in
      the meantime.  Enable this request when CONFIG_CIFS_STATS2 is on
      (only for smb3 mounts since it is an SMB3 or later ioctl).
      Signed-off-by: NSteve French <smfrench@gmail.com>
      c481e9fe
    • S
      Fix unused variable warning when CIFS POSIX disabled · f10d9ba4
      Steve French 提交于
      Fix unused variable warning when CONFIG_CIFS_POSIX disabled.
      
         fs/cifs/ioctl.c: In function 'cifs_ioctl':
      >> fs/cifs/ioctl.c:40:8: warning: unused variable 'ExtAttrMask' [-Wunused-variable]
           __u64 ExtAttrMask = 0;
                 ^
      Pointed out by 0-DAY kernel build testing backend
      Signed-off-by: NSteve French <smfrench@gmail.com>
      f10d9ba4
    • S
      Allow setting per-file compression via CIFS protocol · c7f508a9
      Steve French 提交于
      An earlier patch allowed setting the per-file compression flag
      
      "chattr +c filename"
      
      on an smb2 or smb3 mount, and also allowed lsattr to return
      whether a file on a cifs, or smb2/smb3 mount was compressed.
      
      This patch extends the ability to set the per-file
      compression flag to the cifs protocol, which uses a somewhat
      different IOCTL mechanism than SMB2, although the payload
      (the flags stored in the compression_state) are the same.
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      c7f508a9
    • S
      Query File System Alignment · af6a12ea
      Steven French 提交于
      In SMB3 it is now possible to query the file system
      alignment info, and the preferred (for performance)
      sector size and whether the underlying disk
      has no seek penalty (like SSD).
      
      Query this information at mount time for SMB3,
      and make it visible in /proc/fs/cifs/DebugData
      for debugging purposes.
      
      This alignment information and preferred sector
      size info will be helpful for the copy offload
      patches to setup the right chunks in the CopyChunk
      requests.   Presumably the knowledge that the
      underlying disk is SSD could also help us
      make better readahead and writebehind
      decisions (something to look at in the future).
      Signed-off-by: NSteve French <smfrench@gmail.com>
      af6a12ea
    • S
      Query device characteristics at mount time from server on SMB2/3 not just on cifs mounts · 2167114c
      Steven French 提交于
      Currently SMB2 and SMB3 mounts do not query the device information at mount time
      from the server as is done for cifs.  These can be useful for debugging.
      This is a minor patch, that extends the previous one (which added ability to
      query file system attributes at mount time - this returns the device
      characteristics - also via in /proc/fs/cifs/DebugData)
      Signed-off-by: NSteve French <smfrench@gmail.com>
      2167114c
    • S
      cifs: Send a logoff request before removing a smb session · 7f48558e
      Shirish Pargaonkar 提交于
      Send a smb session logoff request before removing smb session off of the list.
      On a signed smb session, remvoing a session off of the list before sending
      a logoff request results in server returning an error for lack of
      smb signature.
      
      Never seen an error during smb logoff, so as per MS-SMB2 3.2.5.1,
      not sure how an error during logoff should be retried. So for now,
      if a server returns an error to a logoff request, log the error and
      remove the session off of the list.
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      7f48558e
    • T
      cifs: Make big endian multiplex ID sequences monotonic on the wire · 3d378d3f
      Tim Gardner 提交于
      The multiplex identifier (MID) in the SMB header is only
      ever used by the client, in conjunction with PID, to match responses
      from the server. As such, the endianess of the MID is not important.
      However, When tracing packet sequences on the wire, protocol analyzers
      such as wireshark display MID as little endian. It is much more informative
      for the on-the-wire MID sequences to match debug information emitted by the
      CIFS driver.  Therefore, one should write and read MID in the SMB header
      assuming it is always little endian.
      
      Observed from wireshark during the protocol negotiation
      and session setup:
      
              Multiplex ID: 256
              Multiplex ID: 256
              Multiplex ID: 512
              Multiplex ID: 512
              Multiplex ID: 768
              Multiplex ID: 768
      
      After this patch on-the-wire MID values begin at 1 and increase monotonically.
      
      Introduce get_next_mid64() for the internal consumers that use the full 64 bit
      multiplex identifier.
      
      Introduce the helpers get_mid() and compare_mid() to make the endian
      translation clear.
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTim Gardner <timg@tpi.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      3d378d3f
  10. 28 10月, 2013 4 次提交
  11. 25 10月, 2013 2 次提交
  12. 15 10月, 2013 1 次提交
  13. 07 10月, 2013 3 次提交
  14. 06 10月, 2013 1 次提交
    • S
      do not treat non-symlink reparse points as valid symlinks · c31f3307
      Steve French 提交于
      Windows 8 and later can create NFS symlinks (within reparse points)
      which we were assuming were normal NTFS symlinks and thus reporting
      corrupt paths for.  Add check for reparse points to make sure that
      they really are normal symlinks before we try to parse the pathname.
      
      We also should not be parsing other types of reparse points (DFS
      junctions etc) as if they were a  symlink so return EOPNOTSUPP
      on those.  Also fix endian errors (we were not parsing symlink
      lengths as little endian).
      
      This fixes commit d244bf2d
      which implemented follow link for non-Unix CIFS mounts
      
      CC: Stable <stable@kernel.org>
      Reviewed-by: NAndrew Bartlett <abartlet@samba.org>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      c31f3307
  15. 28 9月, 2013 1 次提交
    • D
      FS-Cache: Provide the ability to enable/disable cookies · 94d30ae9
      David Howells 提交于
      Provide the ability to enable and disable fscache cookies.  A disabled cookie
      will reject or ignore further requests to:
      
      	Acquire a child cookie
      	Invalidate and update backing objects
      	Check the consistency of a backing object
      	Allocate storage for backing page
      	Read backing pages
      	Write to backing pages
      
      but still allows:
      
      	Checks/waits on the completion of already in-progress objects
      	Uncaching of pages
      	Relinquishment of cookies
      
      Two new operations are provided:
      
       (1) Disable a cookie:
      
      	void fscache_disable_cookie(struct fscache_cookie *cookie,
      				    bool invalidate);
      
           If the cookie is not already disabled, this locks the cookie against other
           dis/enablement ops, marks the cookie as being disabled, discards or
           invalidates any backing objects and waits for cessation of activity on any
           associated object.
      
           This is a wrapper around a chunk split out of fscache_relinquish_cookie(),
           but it reinitialises the cookie such that it can be reenabled.
      
           All possible failures are handled internally.  The caller should consider
           calling fscache_uncache_all_inode_pages() afterwards to make sure all page
           markings are cleared up.
      
       (2) Enable a cookie:
      
      	void fscache_enable_cookie(struct fscache_cookie *cookie,
      				   bool (*can_enable)(void *data),
      				   void *data)
      
           If the cookie is not already enabled, this locks the cookie against other
           dis/enablement ops, invokes can_enable() and, if the cookie is not an
           index cookie, will begin the procedure of acquiring backing objects.
      
           The optional can_enable() function is passed the data argument and returns
           a ruling as to whether or not enablement should actually be permitted to
           begin.
      
           All possible failures are handled internally.  The cookie will only be
           marked as enabled if provisional backing objects are allocated.
      
      A later patch will introduce these to NFS.  Cookie enablement during nfs_open()
      is then contingent on i_writecount <= 0.  can_enable() checks for a race
      between open(O_RDONLY) and open(O_WRONLY/O_RDWR).  This simplifies NFS's cookie
      handling and allows us to get rid of open(O_RDONLY) accidentally introducing
      caching to an inode that's open for writing already.
      
      One operation has its API modified:
      
       (3) Acquire a cookie.
      
      	struct fscache_cookie *fscache_acquire_cookie(
      		struct fscache_cookie *parent,
      		const struct fscache_cookie_def *def,
      		void *netfs_data,
      		bool enable);
      
           This now has an additional argument that indicates whether the requested
           cookie should be enabled by default.  It doesn't need the can_enable()
           function because the caller must prevent multiple calls for the same netfs
           object and it doesn't need to take the enablement lock because no one else
           can get at the cookie before this returns.
      
      Signed-off-by: David Howells <dhowells@redhat.com
      94d30ae9
  16. 26 9月, 2013 2 次提交