1. 26 12月, 2008 4 次提交
  2. 18 12月, 2008 1 次提交
  3. 27 11月, 2008 1 次提交
    • J
      [CIFS] fix regression in cifs_write_begin/cifs_write_end · a98ee8c1
      Jeff Layton 提交于
      The conversion to write_begin/write_end interfaces had a bug where we
      were passing a bad parameter to cifs_readpage_worker. Rather than
      passing the page offset of the start of the write, we needed to pass the
      offset of the beginning of the page. This was reliably showing up as
      data corruption in the fsx-linux test from LTP.
      
      It also became evident that this code was occasionally doing unnecessary
      read calls. Optimize those away by using the PG_checked flag to indicate
      that the unwritten part of the page has been initialized.
      
      CC: Nick Piggin <npiggin@suse.de>
      Acked-by: NDave Kleikamp <shaggy@us.ibm.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      a98ee8c1
  4. 21 11月, 2008 1 次提交
    • S
      [CIFS] Do not attempt to close invalidated file handles · ddb4cbfc
      Steve French 提交于
      If a connection with open file handles has gone down
      and come back up and reconnected without reopening
      the file handle yet, do not attempt to send an SMB close
      request for this handle in cifs_close.  We were
      checking for the connection being invalid in cifs_close
      but since the connection may have been reconnected
      we also need to check whether the file handle
      was marked invalid (otherwise we could close the
      wrong file handle by accident).
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ddb4cbfc
  5. 19 11月, 2008 1 次提交
  6. 18 11月, 2008 3 次提交
  7. 17 11月, 2008 2 次提交
  8. 15 11月, 2008 3 次提交
  9. 14 11月, 2008 3 次提交
    • S
      [CIFS] clean up server protocol handling · 3ec332ef
      Steve French 提交于
      We're currently declaring both a sockaddr_in and sockaddr6_in on the
      stack, but we really only need storage for one of them. Declare a
      sockaddr struct and cast it to the proper type. Also, eliminate the
      protocolType field in the TCP_Server_Info struct. It's redundant since
      we have a sa_family field in the sockaddr anyway.
      
      We may need to revisit this if SCTP is ever implemented, but for now
      this will simplify the code.
      
      CIFS over IPv6 also has a number of problems currently. This fixes all
      of them that I found. Eventually, it would be nice to move more of the
      code to be protocol independent, but this is a start.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      3ec332ef
    • S
      [CIFS] remove unused list, add new cifs sock list to prepare for mount/umount fix · fb396016
      Steve French 提交于
      Also adds two lines missing from the previous patch (for the need reconnect flag in the
      /proc/fs/cifs/DebugData handling)
      
      The new global_cifs_sock_list is added, and initialized in init_cifs but not used yet.
      Jeff Layton will be adding code in to use that and to remove the GlobalTcon and GlobalSMBSession
      lists.
      
      CC: Jeff Layton <jlayton@redhat.com>
      CC: Shirish Pargaonkar <shirishp@us.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      fb396016
    • 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
  10. 04 11月, 2008 2 次提交
  11. 31 10月, 2008 1 次提交
  12. 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
  13. 23 10月, 2008 5 次提交
    • M
      [PATCH] move executable checking into ->permission() · f696a365
      Miklos Szeredi 提交于
      For execute permission on a regular files we need to check if file has
      any execute bits at all, regardless of capabilites.
      
      This check is normally performed by generic_permission() but was also
      added to the case when the filesystem defines its own ->permission()
      method.  In the latter case the filesystem should be responsible for
      performing this check.
      
      Move the check from inode_permission() inside filesystems which are
      not calling generic_permission().
      
      Create a helper function execute_ok() that returns true if the inode
      is a directory or if any execute bits are present in i_mode.
      
      Also fix up the following code:
      
       - coda control file is never executable
       - sysctl files are never executable
       - hfs_permission seems broken on MAY_EXEC, remove
       - hfsplus_permission is eqivalent to generic_permission(), remove
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      f696a365
    • C
      [PATCH] fix ->llseek for more directories · 3222a3e5
      Christoph Hellwig 提交于
      With this patch all directory fops instances that have a readdir
      that doesn't take the BKL are switched to generic_file_llseek.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      3222a3e5
    • J
      cifs: handle the TCP_Server_Info->tsk field more carefully · b1c8d2b4
      Jeff Layton 提交于
      cifs: handle the TCP_Server_Info->tsk field more carefully
      
      We currently handle the TCP_Server_Info->tsk field without any locking,
      but with some half-measures to try and prevent races. These aren't
      really sufficient though. When taking down cifsd, use xchg() to swap
      the contents of the tsk field with NULL so we don't end up trying
      to send it more than one signal. Also, don't allow cifsd to exit until
      the signal is received if we expect one.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      b1c8d2b4
    • J
      cifs: fix unlinking of rename target when server doesn't support open file renames · 8d281efb
      Jeff Layton 提交于
      cifs: fix unlinking of rename target when server doesn't support open file renames
      
      The patch to make cifs_rename undoable broke renaming one file on top of
      another when the server doesn't support busy file renames. Remove the
      code that uses busy file renames to unlink the target file, and just
      have it call cifs_unlink. If the rename of the source file fails, then
      the unlink won't be undoable, but hopefully that's rare enough that it
      won't be a problem.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      8d281efb
    • 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
  14. 21 10月, 2008 3 次提交
  15. 20 10月, 2008 4 次提交
  16. 17 10月, 2008 3 次提交
    • J
      cifs: don't use CREATE_DELETE_ON_CLOSE in cifs_rename_pending_delete · dd1db2de
      Jeff Layton 提交于
      cifs: don't use CREATE_DELETE_ON_CLOSE in cifs_rename_pending_delete
      
      CREATE_DELETE_ON_CLOSE apparently has different semantics than when you
      set the DELETE_ON_CLOSE bit after opening the file. Setting it in the
      open says "delete this file as soon as this filehandle is closed". That's
      not what we want for cifs_rename_pending_delete.
      
      Don't set this bit in the CreateFlags. Experimentation shows that
      setting this flag in the SET_FILE_INFO call has no effect.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      dd1db2de
    • J
      [CIFS] eliminate usage of kthread_stop for cifsd · 469ee614
      Jeff Layton 提交于
      When cifs_demultiplex_thread was converted to a kthread based kernel
      thread, great pains were taken to make it so that kthread_stop would be
      used to bring it down. This just added unnecessary complexity since we
      needed to use a signal anyway to break out of kernel_recvmsg.
      
      Also, cifs_demultiplex_thread does a bit of cleanup as it's exiting, and
      we need to be certain that this gets done. It's possible for a kthread
      to exit before its main function is ever run if kthread_stop is called
      soon after its creation. While I'm not sure that this is a real problem
      with cifsd now, it could be at some point in the future if cifs_mount is
      ever changed to bring down the thread quickly.
      
      The upshot here is that using kthread_stop to bring down the thread just
      adds extra complexity with no real benefit. This patch changes the code
      to use the original method to bring down the thread, but still leaves it
      so that the thread is actually started with kthread_run.
      
      This seems to fix the deadlock caused by the reproducer in this bug
      report:
      
      https://bugzilla.samba.org/show_bug.cgi?id=5720Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      469ee614
    • S
      [CIFS] Add nodfs mount option · 2c1b8615
      Steve French 提交于
      Older samba server (eg. 3.0.24 from Debian etch) don't work correctly,
      if DFS paths are used. Such server claim that they support DFS, but fail
      to process some requests with DFS paths. Starting with Linux 2.6.26,
      the cifs clients starts sending DFS paths in such situations, rendering
      it unuseable with older samba servers.
      
      The nodfs mount options forces a share to be used with non DFS paths,
      even if the server claims, that it supports it.
      Signed-off-by: NMartin Koegler <mkoegler@auto.tuwien.ac.at>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Acked-by: NIgor Mammedov <niallain@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      2c1b8615
  17. 12 10月, 2008 1 次提交
  18. 09 10月, 2008 1 次提交