1. 07 12月, 2009 1 次提交
  2. 25 11月, 2009 1 次提交
  3. 02 9月, 2009 1 次提交
  4. 04 8月, 2009 1 次提交
  5. 30 7月, 2009 1 次提交
  6. 10 7月, 2009 1 次提交
  7. 25 6月, 2009 1 次提交
  8. 07 6月, 2009 1 次提交
  9. 28 5月, 2009 1 次提交
  10. 04 5月, 2009 1 次提交
    • S
      [CIFS] NTLMSSP reenabled after move from connect.c to sess.c · 0b3cc858
      Steve French 提交于
      The NTLMSSP code was removed from fs/cifs/connect.c and merged
      (75% smaller, cleaner) into fs/cifs/sess.c
      
      As with the old code it requires that cifs be built with
      CONFIG_CIFS_EXPERIMENTAL, the /proc/fs/cifs/Experimental flag
      must be set to 2, and mount must turn on extended security
      (e.g. with sec=krb5).
      
      Although NTLMSSP encapsulated in SPNEGO is not enabled yet,
      "raw" ntlmssp is common and useful in some cases since it
      offers more complete security negotiation, and is the
      default way of negotiating security for many Windows systems.
      SPNEGO encapsulated NTLMSSP will be able to reuse the same
      code.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      0b3cc858
  11. 02 5月, 2009 1 次提交
  12. 01 5月, 2009 1 次提交
    • S
      [CIFS] rename cifs_strndup to cifs_strndup_from_ucs · d185cda7
      Steve French 提交于
      In most cases, cifs_strndup is converting from Unicode (UCS2 / UTF-32) to
      the configured local code page for the Linux mount (usually UTF8), so
      Jeff suggested that to make it more clear that cifs_strndup is doing
      a conversion not just memory allocation and copy, rename the function
      to including "from_ucs" (ie Unicode)
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      d185cda7
  13. 21 4月, 2009 1 次提交
  14. 17 4月, 2009 1 次提交
  15. 18 3月, 2009 1 次提交
  16. 12 3月, 2009 3 次提交
    • S
      [CIFS] work around bug in Samba server handling for posix open · 64cc2c63
      Steve French 提交于
      Samba server (version 3.3.1 and earlier, and 3.2.8 and earlier) incorrectly
      required the O_CREAT flag on posix open (even when a file was not being
      created).  This disables posix open (create is still ok) after the first
      attempt returns EINVAL (and logs an error, once, recommending that they
      update their server).
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      64cc2c63
    • S
      [CIFS] Add new nostrictsync cifs mount option to avoid slow SMB flush · be652445
      Steve French 提交于
      If this mount option is set, when an application does an
      fsync call then the cifs client does not send an SMB Flush
      to the server (to force the server to write all dirty data
      for this file immediately to disk), although cifs still sends
      all dirty (cached) file data to the server and waits for the
      server to respond to the write write.  Since SMB Flush can be
      very slow, and some servers may be reliable enough (to risk
      delaying slightly flushing the data to disk on the server),
      turning on this option may be useful to improve performance for
      applications that fsync too much, at a small risk of server
      crash.  If this mount option is not set, by default cifs will
      send an SMB flush request (and wait for a response) on every
      fsync call.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      be652445
    • S
      [CIFS] Send SMB flush in cifs_fsync · b298f223
      Steve French 提交于
      In contrast to the now-obsolete smbfs, cifs does not send SMB_COM_FLUSH
      in response to an explicit fsync(2) to guarantee that all volatile data
      is written to stable storage on the server side, provided the server
      honors the request (which, to my knowledge, is true for Windows and
      Samba with 'strict sync' enabled).
      This patch modifies the cifs_fsync implementation to restore the
      fsync-behavior of smbfs by triggering SMB_COM_FLUSH after sending
      outstanding data on the client side to the server.
      Signed-off-by: NHorst Reiterer <horst.reiterer@gmail.com>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      b298f223
  17. 21 2月, 2009 3 次提交
    • S
      [CIFS] Fix multiuser mounts so server does not invalidate earlier security contexts · eca6acf9
      Steve French 提交于
      When two different users mount the same Windows 2003 Server share using CIFS,
      the first session mounted can be invalidated.  Some servers invalidate the first
      smb session when a second similar user (e.g. two users who get mapped by server to "guest")
      authenticates an smb session from the same client.
      
      By making sure that we set the 2nd and subsequent vc numbers to nonzero values,
      this ensures that we will not have this problem.
      
      Fixes Samba bug 6004, problem description follows:
      How to reproduce:
      
      - configure an "open share" (full permissions to Guest user) on Windows 2003
      Server (I couldn't reproduce the problem with Samba server or Windows older
      than 2003)
      - mount the share twice with different users who will be authenticated as guest.
      
       noacl,noperm,user=john,dir_mode=0700,domain=DOMAIN,rw
       noacl,noperm,user=jeff,dir_mode=0700,domain=DOMAIN,rw
      
      Result:
      
      - just the mount point mounted last is accessible:
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      eca6acf9
    • S
      [CIFS] improve posix semantics of file create · c3b2a0c6
      Steve French 提交于
      Samba server added support for a new posix open/create/mkdir operation
      a year or so ago, and we added support to cifs for mkdir to use it,
      but had not added the corresponding code to file create.
      
      The following patch helps improve the performance of the cifs create
      path (to Samba and servers which support the cifs posix protocol
      extensions).  Using Connectathon basic test1, with 2000 files, the
      performance improved about 15%, and also helped reduce network traffic
      (17% fewer SMBs sent over the wire) due to saving a network round trip
      for the SetPathInfo on every file create.
      
      It should also help the semantics (and probably the performance) of
      write (e.g. when posix byte range locks are on the file) on file
      handles opened with posix create, and adds support for a few flags
      which would have to be ignored otherwise.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      c3b2a0c6
    • S
      [CIFS] Fix oops in cifs_strfromUCS_le mounting to servers which do not specify their OS · 69765529
      Steve French 提交于
      Fixes kernel bug #10451 http://bugzilla.kernel.org/show_bug.cgi?id=10451
      
      Certain NAS appliances do not set the operating system or network operating system
      fields in the session setup response on the wire.  cifs was oopsing on the unexpected
      zero length response fields (when trying to null terminate a zero length field).
      
      This fixes the oops.
      Acked-by: NJeff Layton <jlayton@redhat.com>
      CC: stable <stable@kernel.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      69765529
  18. 29 1月, 2009 1 次提交
    • S
      [CIFS] revalidate parent inode when rmdir done within that directory · 42c24544
      Steve French 提交于
      When a search is pending of a parent directory, and a child directory
      within it is removed, we need to reset the parent directory's time
      so that we don't reuse the (now stale) search results.
      
      Thanks to Gunter Kukkukk for reporting this:
      
      > got the following failure notification on irc #samba:
      >
      > A user was updating from subversion 1.4 to 1.5, where the
      > repository is located on a samba share (independent of
      > unix extensions = Yes or No).
      > svn 1.4 did work, 1.5 does not.
      >
      > The user did a lot of stracing of subversion - and wrote a
      > testapplet to simulate the failing behaviour.
      > I've converted the C++ source to C and added some error cases.
      >
      > When using "./testdir" on a local file system, "result2"
      > is always (nil) as expected - cifs vfs behaves different here!
      >
      >   ./testdir /mnt/cifs/mounted/share
      >
      > returns a (failing) valid pointer.
      Acked-by: NDave Kleikamp <shaggy@us.ibm.com>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      42c24544
  19. 26 12月, 2008 3 次提交
    • S
      [CIFS] make sure that DFS pathnames are properly formed · c6fbba05
      Steve French 提交于
      The paths in a DFS request are supposed to only have a single preceding
      backslash, but we are sending them with a double backslash. This is
      exposing a bug in Windows where it also sends a path in the response
      that has a double backslash.
      
      The existing code that builds the mount option string however expects a
      double backslash prefix in a couple of places when it tries to use the
      path returned by build_path_from_dentry. Fix compose_mount_options to
      expect properly formed DFS paths (single backslash at front).
      
      Also clean up error handling in that function. There was a possible
      NULL pointer dereference and situations where a partially built option
      string would be returned.
      
      Tested against Samba 3.0.28-ish server and Samba 3.3 and Win2k8.
      
      CC: Stable <stable@kernel.org>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      c6fbba05
    • S
      [CIFS] Can not mount with prefixpath if root directory of share is inaccessible · 8be0ed44
      Steve French 提交于
      Windows allows you to deny access to the top of a share, but permit access to
      a directory lower in the path.  With the prefixpath feature of cifs
      (ie mounting \\server\share\directory\subdirectory\etc.) this should have
      worked if the user specified a prefixpath which put the root of the mount
      at a directory to which he had access, but we still were doing a lookup
      on the root of the share (null path) when we should have been doing it on
      the prefixpath subdirectory.
      
      This fixes Samba bug # 5925
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      8be0ed44
    • S
      [CIFS] add mount option to send mandatory rather than advisory locks · 13a6e42a
      Steve French 提交于
      Some applications/subsystems require mandatory byte range locks
      (as is used for Windows/DOS/OS2 etc). Sending advisory (posix style)
      byte range lock requests (instead of mandatory byte range locks) can
      lead to problems for these applications (which expect that other
      clients be prevented from writing to portions of the file which
      they have locked and are updating).  This mount option allows
      mounting cifs with the new mount option "forcemand" (or
      "forcemandatorylock") in order to have the cifs client use mandatory
      byte range locks (ie SMB/CIFS/Windows/NTFS style locks) rather than
      posix byte range lock requests, even if the server would support
      posix byte range lock requests.  This has no effect if the server
      does not support the CIFS Unix Extensions (since posix style locks
      require support for the CIFS Unix Extensions), but for mounts
      to Samba servers this can be helpful for Wine and applications
      that require mandatory byte range locks.
      Acked-by: NJeff Layton <jlayton@redhat.com>
      CC: Alexander Bokovoy <ab@samba.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      13a6e42a
  20. 19 11月, 2008 1 次提交
  21. 29 10月, 2008 1 次提交
    • S
      [CIFS] Reduce number of socket retries in large write path · edf1ae40
      Steve French 提交于
      CIFS in some heavy stress conditions cifs could get EAGAIN
      repeatedly in smb_send2 which led to repeated retries and eventually
      failure of large writes which could lead to data corruption.
      
      There are three changes that were suggested by various network
      developers:
      
      1) convert cifs from non-blocking to blocking tcp sendmsg
      (we left in the retry on failure)
      2) change cifs to not set sendbuf and rcvbuf size for the socket
      (let tcp autotune the buffer sizes since that works much better
      in the TCP stack now)
      3) if we have a partial frame sent in smb_send2, mark the tcp
      session as invalid (close the socket and reconnect) so we do
      not corrupt the remaining part of the SMB with the beginning
      of the next SMB.
      
      This does not appear to hurt performance measurably and has
      been run in various scenarios, but it definately removes
      a corruption that we were seeing in some high stress
      test cases.
      Acked-by: NShirish Pargaonkar <shirishp@us.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      edf1ae40
  22. 23 10月, 2008 1 次提交
    • S
      [CIFS] improve setlease handling · 84210e91
      Steve French 提交于
      fcntl(F_SETLEASE) currently is not exported by cifs (nor by local file
      systems) so cifs grants leases based on how other local processes have
      opened the file not by whether the file is cacheable (oplocked).  This
      adds the check to make sure that the file is cacheable on the client
      before checking whether we can grant the lease locally
      (generic_setlease).  It also adds a mount option for cifs (locallease)
      if the user wants to override this and try to grant leases even
      if the server did not grant oplock.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      84210e91
  23. 20 10月, 2008 1 次提交
  24. 28 8月, 2008 2 次提交
  25. 26 8月, 2008 1 次提交
  26. 06 8月, 2008 1 次提交
  27. 11 6月, 2008 1 次提交
  28. 21 5月, 2008 1 次提交
  29. 13 5月, 2008 1 次提交
    • J
      fix memory leak in CIFSFindNext · 6353450a
      Jeff Layton 提交于
      When CIFSFindNext gets back an -EBADF from a call, it sets the return
      code of the function to 0 and eventually exits. Doing this makes the
      cleanup at the end of the function skip freeing the SMB buffer, so
      we need to make sure we free the buffer explicitly when doing this.
      
      If we don't you end up with errors like this when unplugging the cifs
      kernel module:
      
      slab error in kmem_cache_destroy(): cache `cifs_request': Can't free all objects
       [<c046bdbf>] kmem_cache_destroy+0x61/0xf3
       [<e0f03045>] cifs_destroy_request_bufs+0x14/0x28 [cifs]
       [<e0f2016e>] exit_cifs+0x1e/0x80 [cifs]
       [<c043aeae>] sys_delete_module+0x192/0x1b8
       [<c04451fd>] audit_syscall_entry+0x14b/0x17d
       [<c0405413>] syscall_call+0x7/0xb
       =======================
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      6353450a
  30. 28 4月, 2008 1 次提交
  31. 05 4月, 2008 1 次提交
  32. 14 2月, 2008 1 次提交
    • S
      [CIFS] fixup prefixpaths which contain multiple path components · 03a143c9
      Steve French 提交于
      Currently, when we get a prefixpath as part of mount, the kernel only
      changes the first character to be a '/' or '\' depending on whether
      posix extensions are enabled. This is problematic as it expects
      mount.cifs to pass in the correct delimiter in the rest of the
      prefixpath. But, mount.cifs may not know *what* the correct delimiter
      is. It's a chicken and egg problem.
      
      Note that mount.cifs should not do conversion of the
      prefixpath - if we want posix behavior then '\' is legal in a path
      (and we have had bugs in the distant path to prove to me that
      customers sometimes have apps that require '\').  The kernel code
      assumes that the path passed in is posix (and current code will handle
      the first path component fine but was broken for Windows mounts
      for "deep" prefixpaths unless the user specified a prefixpath with '\'
      deep in it.   So e.g. with current kernel code:
      
      1) mount to //server/share/dir1 will work to all server types
      2) mount to //server/share/dir1/subdir1 will work to Samba
      3) mount to //server/share/dir1\\subdir1 will work to Windows
      
      But case two would fail to Windows without the fix.
      With the kernel cifs module fix case two now works.
      
      First analyzed by Jeff Layton and Simo Sorce
      
      CC: Jeff Layton <jlayton@redhat.com>
      CC: Simo Sorce <simo@samba.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      03a143c9
  33. 31 12月, 2007 1 次提交