1. 27 5月, 2009 1 次提交
    • J
      cifs: fix artificial limit on reading symlinks · 46a7574c
      Jeff Layton 提交于
      There's no reason to limit the size of a symlink that we can read to
      4000 bytes. That may be nowhere near PATH_MAX if the server is sending
      UCS2 strings. CIFS should be able to read in a symlink up to the size of
      the buffer. The size of the header has already been accounted for when
      creating the slabcache, so CIFSMaxBufSize should be the correct size to
      pass in.
      
      Fixes samba bug #6384.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      46a7574c
  2. 19 5月, 2009 1 次提交
    • J
      cifs: fix pointer initialization and checks in cifs_follow_symlink (try #4) · 8b6427a2
      Jeff Layton 提交于
      This is the third respin of the patch posted yesterday to fix the error
      handling in cifs_follow_symlink. It also includes a fix for a bogus NULL
      pointer check in CIFSSMBQueryUnixSymLink that Jeff Moyer spotted.
      
      It's possible for CIFSSMBQueryUnixSymLink to return without setting
      target_path to a valid pointer. If that happens then the current value
      to which we're initializing this pointer could cause an oops when it's
      kfree'd.
      
      This patch is a little more comprehensive than the last patches. It
      reorganizes cifs_follow_link a bit for (hopefully) better readability.
      It should also eliminate the uneeded allocation of full_path on servers
      without unix extensions (assuming they can get to this point anyway, of
      which I'm not convinced).
      
      On a side note, I'm not sure I agree with the logic of enabling this
      query even when unix extensions are disabled on the client. It seems
      like that should disable this as well. But, changing that is outside the
      scope of this fix, so I've left it alone for now.
      Reported-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NJeff Moyer <jmoyer@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@inraded.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      8b6427a2
  3. 14 5月, 2009 1 次提交
  4. 06 5月, 2009 1 次提交
  5. 02 5月, 2009 3 次提交
  6. 01 5月, 2009 2 次提交
    • S
      [CIFS] Remove sparse endian warnings · 0e0d2cf3
      Steve French 提交于
      Removes two sparse CHECK_ENDIAN warnings from Jeffs earlier patch,
      and removes the dead readlink code (after noting where in
      findfirst we will need to add something like that in the future
      to handle the newly discovered unexpected error on FindFirst of NTFS symlinks.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      0e0d2cf3
    • 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
  7. 30 4月, 2009 3 次提交
  8. 21 4月, 2009 1 次提交
  9. 17 4月, 2009 2 次提交
    • J
      cifs: vary timeout on writes past EOF based on offset (try #5) · fbec9ab9
      Jeff Layton 提交于
      This is the fourth version of this patch:
      
      The first three generated a compiler warning asking for explicit curly
      braces.
      
      The first two didn't handle update the size correctly when writes that
      didn't start at the eof were done.
      
      The first patch also didn't update the size correctly when it explicitly
      set via truncate().
      
      This patch adds code to track the client's current understanding of the
      size of the file on the server separate from the i_size, and then to use
      this info to semi-intelligently set the timeout for writes past the EOF.
      
      This helps prevent timeouts when trying to write large, sparse files on
      windows servers.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      fbec9ab9
    • S
      [CIFS] Endian convert UniqueId when reporting inode numbers from server files · 85a6dac5
      Steve French 提交于
      Jeff made a good point that we should endian convert the UniqueId when we use
      it to set i_ino Even though this value is opaque to the client, when comparing
      the inode numbers of the same server file from two different clients (one
      big endian, one little endian) or when we compare a big endian client's view
      of i_ino with what the server thinks - we should get the same value
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      85a6dac5
  10. 12 3月, 2009 2 次提交
  11. 21 2月, 2009 1 次提交
    • 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
  12. 26 12月, 2008 3 次提交
  13. 18 12月, 2008 1 次提交
  14. 19 11月, 2008 1 次提交
  15. 18 11月, 2008 1 次提交
  16. 17 11月, 2008 1 次提交
  17. 15 11月, 2008 2 次提交
    • J
      cifs: reinstate sharing of SMB sessions sans races · 14fbf50d
      Jeff Layton 提交于
      We do this by abandoning the global list of SMB sessions and instead
      moving to a per-server list. This entails adding a new list head to the
      TCP_Server_Info struct. The refcounting for the cifsSesInfo is moved to
      a non-atomic variable. We have to protect it by a lock anyway, so there's
      no benefit to making it an atomic. The list and refcount are protected
      by the global cifs_tcp_ses_lock.
      
      The patch also adds a new routines to find and put SMB sessions and
      that properly take and put references under the lock.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      14fbf50d
    • J
      cifs: disable sharing session and tcon and add new TCP sharing code · e7ddee90
      Jeff Layton 提交于
      The code that allows these structs to be shared is extremely racy.
      Disable the sharing of SMB and tcon structs for now until we can
      come up with a way to do this that's race free.
      
      We want to continue to share TCP sessions, however since they are
      required for multiuser mounts. For that, implement a new (hopefully
      race-free) scheme. Add a new global list of TCP sessions, and take
      care to get a reference to it whenever we're dealing with one.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      e7ddee90
  18. 14 11月, 2008 1 次提交
    • S
      [CIFS] Fix cifs reconnection flags · 3b795210
      Steve French 提交于
      In preparation for Jeff's big umount/mount fixes to remove the possibility of
      various races in cifs mount and linked list handling of sessions, sockets and
      tree connections, this patch cleans up some repetitive code in cifs_mount,
      and addresses a problem with ses->status and tcon->tidStatus in which we
      were overloading the "need_reconnect" state with other status in that
      field.  So the "need_reconnect" flag has been broken out from those
      two state fields (need reconnect was not mutually exclusive from some of the
      other possible tid and ses states).  In addition, a few exit cases in
      cifs_mount were cleaned up, and a problem with a tcon flag (for lease support)
      was not being set consistently for the 2nd mount of the same share
      
      CC: Jeff Layton <jlayton@redhat.com>
      CC: Shirish Pargaonkar <shirishp@us.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      3b795210
  19. 31 10月, 2008 1 次提交
  20. 20 10月, 2008 1 次提交
  21. 09 10月, 2008 1 次提交
  22. 08 10月, 2008 1 次提交
    • S
      [CIFS] make sure we have the right resume info before calling CIFSFindNext · 0752f152
      Steve French 提交于
      When we do a seekdir() or equivalent, we usually end up doing a
      FindFirst call and then call FindNext until we get to the offset that we
      want. The problem is that when we call FindNext, the code usually
      doesn't have the proper info (mostly, the filename of the entry from the
      last search) to resume the search.
      
      Add a "last_entry" field to the cifs_search_info that points to the last
      entry in the search. We calculate this pointer by using the
      LastNameOffset field from the search parms that are returned. We then
      use that info to do a cifs_save_resume_key before we call CIFSFindNext.
      
      This patch allows CIFS to reliably pass the "telldir" connectathon test.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      CC: Stable <stable@kernel.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      0752f152
  23. 25 9月, 2008 1 次提交
  24. 24 9月, 2008 1 次提交
  25. 09 8月, 2008 1 次提交
  26. 06 8月, 2008 4 次提交
  27. 24 7月, 2008 1 次提交