1. 17 6月, 2010 1 次提交
    • J
      cifs: move cifs_new_fileinfo call out of cifs_posix_open · 2422f676
      Jeff Layton 提交于
      Having cifs_posix_open call cifs_new_fileinfo is problematic and
      inconsistent with how "regular" opens work. It's also buggy as
      cifs_reopen_file calls this function on a reconnect, which creates a new
      struct cifsFileInfo that just gets leaked.
      
      Push it out into the callers. This also allows us to get rid of the
      "mnt" arg to cifs_posix_open.
      
      Finally, in the event that a cifsFileInfo isn't or can't be created, we
      always want to close the filehandle out on the server as the client
      won't have a record of the filehandle and can't actually use it. Make
      sure that CIFSSMBClose is called in those cases.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-and-Tested-by: NSuresh Jayaraman <sjayaraman@suse.de>
      2422f676
  2. 18 5月, 2010 1 次提交
  3. 06 5月, 2010 2 次提交
  4. 28 4月, 2010 1 次提交
  5. 23 4月, 2010 1 次提交
  6. 21 4月, 2010 1 次提交
    • J
      [CIFS] Neaten cERROR and cFYI macros, reduce text space · b6b38f70
      Joe Perches 提交于
      Neaten cERROR and cFYI macros, reduce text space
      ~2.5K
      
      Convert '__FILE__ ": " fmt' to '"%s: " fmt', __FILE__' to save text space
      Surround macros with do {} while
      Add parentheses to macros
      Make statement expression macro from macro with assign
      Remove now unnecessary parentheses from cFYI and cERROR uses
      
      defconfig with CIFS support old
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       156012	   1760	    148	 157920	  268e0	fs/cifs/built-in.o
      
      defconfig with CIFS support old
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       153508	   1760	    148	 155416	  25f18	fs/cifs/built-in.o
      
      allyesconfig old:
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       309138	   3864	  74824	 387826	  5eaf2	fs/cifs/built-in.o
      
      allyesconfig new
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       305655	   3864	  74824	 384343	  5dd57	fs/cifs/built-in.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      b6b38f70
  7. 10 3月, 2010 1 次提交
  8. 06 3月, 2010 2 次提交
  9. 24 2月, 2010 1 次提交
  10. 07 11月, 2009 1 次提交
  11. 25 9月, 2009 3 次提交
    • J
      cifs: fix problems with last two commits · 5d2c0e22
      Jeff Layton 提交于
      Fix problems with commits:
      
      086f68bd
      3bc303c2Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      5d2c0e22
    • J
      cifs: eliminate cifs_init_private · 086f68bd
      Jeff Layton 提交于
      ...it does the same thing as cifs_fill_fileinfo, but doesn't handle the
      flist ordering correctly. Also rename cifs_fill_fileinfo to a more
      descriptive name and have it take an open flags arg instead of just a
      write_only flag. That makes the logic in the callers a little simpler.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      086f68bd
    • J
      cifs: convert oplock breaks to use slow_work facility (try #4) · 3bc303c2
      Jeff Layton 提交于
      This is the fourth respin of the patch to convert oplock breaks to
      use the slow_work facility.
      
      A customer of ours was testing a backport of one of the earlier
      patchsets, and hit a "Busy inodes after umount..." problem. An oplock
      break job had raced with a umount, and the superblock got torn down and
      its memory reused. When the oplock break job tried to dereference the
      inode->i_sb, the kernel oopsed.
      
      This patchset has the oplock break job hold an inode and vfsmount
      reference until the oplock break completes.  With this, there should be
      no need to take a tcon reference (the vfsmount implicitly holds one
      already).
      
      Currently, when an oplock break comes in there's a chance that the
      oplock break job won't occur if the allocation of the oplock_q_entry
      fails. There are also some rather nasty races in the allocation and
      handling these structs.
      
      Rather than allocating oplock queue entries when an oplock break comes
      in, add a few extra fields to the cifsFileInfo struct. Get rid of the
      dedicated cifs_oplock_thread as well and queue the oplock break job to
      the slow_work thread pool.
      
      This approach also has the advantage that the oplock break jobs can
      potentially run in parallel rather than be serialized like they are
      today.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      3bc303c2
  12. 16 9月, 2009 1 次提交
    • J
      cifs: fix oplock request handling in posix codepath · 590a3fe0
      Jeff Layton 提交于
      cifs_posix_open takes a "poplock" argument that's intended to be used in
      the actual posix open call to set the "Flags" field. It ignores this
      value however and declares an "oplock" parameter on the stack that it
      passes uninitialized to the CIFSPOSIXOpen function. Not only does this
      mean that the oplock request flags are bogus, but the result that's
      expected to be in that variable is unchanged.
      
      Fix this, and also clean up the type of the oplock parameter used. Since
      it's expected to be __u32, we should use that everywhere and not
      implicitly cast it from a signed type.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      590a3fe0
  13. 10 7月, 2009 3 次提交
  14. 02 7月, 2009 1 次提交
    • J
      cifs: add new cifs_iget function and convert unix codepath to use it · cc0bad75
      Jeff Layton 提交于
      cifs: add new cifs_iget function and convert unix codepath to use it
      
      In order to unify some codepaths, introduce a common cifs_fattr struct
      for storing inode attributes. The different codepaths (unix, legacy,
      normal, etc...) can fill out this struct with inode info. It can then be
      passed as an arg to a common set of routines to get and update inodes.
      
      Add a new cifs_iget function that uses iget5_locked to identify inodes.
      This will compare inodes based on the uniqueid value in a cifs_fattr
      struct.
      
      Rather than filling out an already-created inode, have
      cifs_get_inode_info_unix instead fill out cifs_fattr and hand that off
      to cifs_iget. cifs_iget can then properly look for hardlinked inodes.
      
      On the readdir side, add a new cifs_readdir_lookup function that spawns
      populated dentries. Redefine FILE_UNIX_INFO so that it's basically a
      FILE_UNIX_BASIC_INFO that has a few fields wrapped around it. This
      allows us to more easily use the same function for filling out the fattr
      as the non-readdir codepath.
      
      With this, we should then have proper hardlink detection and can
      eventually get rid of some nasty CIFS-specific hacks for handing them.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      cc0bad75
  15. 13 6月, 2009 1 次提交
  16. 29 5月, 2009 1 次提交
  17. 28 5月, 2009 2 次提交
  18. 30 4月, 2009 2 次提交
  19. 18 3月, 2009 1 次提交
  20. 12 3月, 2009 2 次提交
  21. 21 2月, 2009 4 次提交
  22. 29 1月, 2009 1 次提交
    • J
      cifs: turn smb_send into a wrapper around smb_sendv · 0496e02d
      Jeff Layton 提交于
      cifs: turn smb_send into a wrapper around smb_sendv
      
      Rename smb_send2 to smb_sendv to make it consistent with kernel naming
      conventions for functions that take a vector.
      
      There's no need to have 2 functions to handle sending SMB calls. Turn
      smb_send into a wrapper around smb_sendv. This also allows us to
      properly mark the socket as needing to be reconnected when there's a
      partial send from smb_send.
      
      Also, in practice we always use the address and noblocksnd flag
      that's attached to the TCP_Server_Info. There's no need to pass
      them in as separate args to smb_sendv.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Acked-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      0496e02d
  23. 26 12月, 2008 1 次提交
  24. 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
  25. 14 11月, 2008 1 次提交
  26. 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
  27. 25 9月, 2008 1 次提交