1. 21 3月, 2015 1 次提交
  2. 15 12月, 2014 1 次提交
    • S
      Convert MessageID in smb2_hdr to LE · 9235d098
      Sachin Prabhu 提交于
      We have encountered failures when When testing smb2 mounts on ppc64
      machines when using both Samba as well as Windows 2012.
      
      On poking around, the problem was determined to be caused by the
      high endian MessageID passed in the header for smb2. On checking the
      corresponding MID for smb1 is converted to LE before being sent on the
      wire.
      
      We have tested this patch successfully on a ppc64 machine.
      Signed-off-by: NSachin Prabhu <sprabhu@redhat.com>
      9235d098
  3. 11 12月, 2014 1 次提交
  4. 08 12月, 2014 1 次提交
  5. 17 10月, 2014 4 次提交
  6. 26 8月, 2014 1 次提交
  7. 21 8月, 2014 1 次提交
  8. 18 8月, 2014 2 次提交
  9. 17 8月, 2014 1 次提交
    • P
      CIFS: Fix SMB2 readdir error handling · 52755808
      Pavel Shilovsky 提交于
      SMB2 servers indicates the end of a directory search with
      STATUS_NO_MORE_FILE error code that is not processed now.
      This causes generic/257 xfstest to fail. Fix this by triggering
      the end of search by this error code in SMB2_query_directory.
      
      Also when negotiating CIFS protocol we tell the server to close
      the search automatically at the end and there is no need to do
      it itself. In the case of SMB2 protocol, we need to close it
      explicitly - separate close directory checks for different
      protocols.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NPavel Shilovsky <pshilovsky@samba.org>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      52755808
  10. 16 8月, 2014 1 次提交
  11. 14 8月, 2014 1 次提交
    • S
      Add sparse file support to SMB2/SMB3 mounts · 3d1a3745
      Steve French 提交于
      Many Linux filesystes make a file "sparse" when extending
      a file with ftruncate. This does work for CIFS to Samba
      (only) but not for SMB2/SMB3 (to Samba or Windows) since
      there is a "set sparse" fsctl which is supposed to be
      sent to mark a file as sparse.
      
      This patch marks a file as sparse by sending this simple
      set sparse fsctl if it is extended more than 2 pages.
      It has been tested to Windows 8.1, Samba and various
      SMB2/SMB3 servers which do support setting sparse (and
      MacOS which does not appear to support the fsctl yet).
      If a server share does not support setting a file
      as sparse, then we do not retry setting sparse on that
      share.
      
      The disk space savings for sparse files can be quite
      large (even more significant on Windows servers than Samba).
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Reviewed-by: NShirish Pargaonkar <spargaonkar@suse.com>
      3d1a3745
  12. 06 8月, 2014 1 次提交
  13. 02 8月, 2014 3 次提交
  14. 22 5月, 2014 1 次提交
  15. 17 4月, 2014 1 次提交
    • S
      cifs: Wait for writebacks to complete before attempting write. · c11f1df5
      Sachin Prabhu 提交于
      Problem reported in Red Hat bz 1040329 for strict writes where we cache
      only when we hold oplock and write direct to the server when we don't.
      
      When we receive an oplock break, we first change the oplock value for
      the inode in cifsInodeInfo->oplock to indicate that we no longer hold
      the oplock before we enqueue a task to flush changes to the backing
      device. Once we have completed flushing the changes, we return the
      oplock to the server.
      
      There are 2 ways here where we can have data corruption
      1) While we flush changes to the backing device as part of the oplock
      break, we can have processes write to the file. These writes check for
      the oplock, find none and attempt to write directly to the server.
      These direct writes made while we are flushing from cache could be
      overwritten by data being flushed from the cache causing data
      corruption.
      2) While a thread runs in cifs_strict_writev, the machine could receive
      and process an oplock break after the thread has checked the oplock and
      found that it allows us to cache and before we have made changes to the
      cache. In that case, we end up with a dirty page in cache when we
      shouldn't have any. This will be flushed later and will overwrite all
      subsequent writes to the part of the file represented by this page.
      
      Before making any writes to the server, we need to confirm that we are
      not in the process of flushing data to the server and if we are, we
      should wait until the process is complete before we attempt the write.
      We should also wait for existing writes to complete before we process
      an oplock break request which changes oplock values.
      
      We add a version specific  downgrade_oplock() operation to allow for
      differences in the oplock values set for the different smb versions.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NSachin Prabhu <sprabhu@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NPavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      c11f1df5
  16. 15 2月, 2014 1 次提交
  17. 20 11月, 2013 1 次提交
  18. 19 11月, 2013 1 次提交
    • S
      CIFS: Fix SMB2/SMB3 Copy offload support (refcopy) for large files · 9bf0c9cd
      Steve French 提交于
      This third version of the patch, incorparating feedback from David Disseldorp
      extends the ability of copychunk (refcopy) over smb2/smb3 mounts to
      handle servers with smaller than usual maximum chunk sizes
      and also fixes it to handle files bigger than the maximum chunk sizes
      
      In the future this can be extended further to handle sending
      multiple chunk requests in on SMB2 ioctl request which will
      further improve performance, but even with one 1MB chunk per
      request the speedup on cp is quite large.
      Reviewed-by: NDavid Disseldorp <ddiss@samba.org>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      9bf0c9cd
  19. 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
  20. 03 11月, 2013 3 次提交
    • 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
      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
  21. 28 10月, 2013 2 次提交
  22. 10 9月, 2013 5 次提交
  23. 09 9月, 2013 2 次提交
  24. 11 7月, 2013 3 次提交