1. 29 12月, 2008 1 次提交
  2. 26 12月, 2008 3 次提交
  3. 17 11月, 2008 1 次提交
  4. 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
  5. 14 11月, 2008 2 次提交
    • 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
  6. 23 10月, 2008 3 次提交
    • 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
    • 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
  7. 20 10月, 2008 1 次提交
  8. 12 8月, 2008 2 次提交
  9. 09 8月, 2008 1 次提交
  10. 27 7月, 2008 2 次提交
  11. 03 7月, 2008 1 次提交
    • A
      Remove BKL from remote_llseek v2 · 9465efc9
      Andi Kleen 提交于
      - Replace remote_llseek with generic_file_llseek_unlocked (to force compilation
      failures in all users)
      - Change all users to either use generic_file_llseek_unlocked directly or
      take the BKL around. I changed the file systems who don't use the BKL
      for anything (CIFS, GFS) to call it directly. NCPFS and SMBFS and NFS
      take the BKL, but explicitely in their own source now.
      
      I moved them all over in a single patch to avoid unbisectable sections.
      
      Open problem: 32bit kernels can corrupt fpos because its modification
      is not atomic, but they can do that anyways because there's other paths who
      modify it without BKL.
      
      Do we need a special lock for the pos/f_version = 0 checks?
      
      Trond says the NFS BKL is likely not needed, but keep it for now
      until his full audit.
      
      v2: Use generic_file_llseek_unlocked instead of remote_llseek_unlocked
          and factor duplicated code (suggested by hch)
      
      Cc: Trond.Myklebust@netapp.com
      Cc: swhiteho@redhat.com
      Cc: sfrench@samba.org
      Cc: vandrove@vc.cvut.cz
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      9465efc9
  12. 11 6月, 2008 1 次提交
  13. 20 5月, 2008 1 次提交
  14. 17 5月, 2008 1 次提交
    • S
      [CIFS] add more complete mount options to cifs_show_options · 2b280fab
      Steve French 提交于
      adds various options to cifs_show_options
      (displayed when you cat /proc/mounts with a cifs mount).  I limited
      the new ones to values that are associated with the mount with the
      exception of "seal" (which is a per tree connection property, but I
      thought was important enough to show through).
      
      Eventually cifs's parse_mount_options also needs to
      be rewritten to use the match_token API but that would be a big enough
      change that I would prefer that changing parse_mount_options wait
      until next release.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      2b280fab
  15. 15 5月, 2008 1 次提交
  16. 29 4月, 2008 1 次提交
  17. 28 4月, 2008 1 次提交
  18. 25 4月, 2008 2 次提交
  19. 13 2月, 2008 2 次提交
  20. 08 2月, 2008 2 次提交
  21. 25 1月, 2008 1 次提交
  22. 11 1月, 2008 1 次提交
  23. 10 1月, 2008 1 次提交
  24. 21 11月, 2007 1 次提交
    • J
      [CIFS] Fix potential data corruption when writing out cached dirty pages · cea21805
      Jeff Layton 提交于
      Fix RedHat bug 329431
      
      The idea here is separate "conscious" from "unconscious" flushes.
      Conscious flushes are those due to a fsync() or close(). Unconscious
      ones are flushes that occur as a side effect of some other operation or
      due to memory pressure.
      
      Currently, when an error occurs during an unconscious flush (ENOSPC or
      EIO), we toss out the page and don't preserve that error to report to
      the user when a conscious flush occurs. If after the unconscious flush,
      there are no more dirty pages for the inode, the conscious flush will
      simply return success even though there were previous errors when writing
      out pages. This can lead to data corruption.
      
      The easiest way to reproduce this is to mount up a CIFS share that's
      very close to being full or where the user is very close to quota. mv
      a file to the share that's slightly larger than the quota allows. The
      writes will all succeed (since they go to pagecache). The mv will do a
      setattr to set the new file's attributes. This calls
      filemap_write_and_wait,
      which will return an error since all of the pages can't be written out.
      Then later, when the flush and release ops occur, there are no more
      dirty pages in pagecache for the file and those operations return 0. mv
      then assumes that the file was written out correctly and deletes the
      original.
      
      CIFS already has a write_behind_rc variable where it stores the results
      from earlier flushes, but that value is only reported in cifs_close.
      Since the VFS ignores the return value from the release operation, this
      isn't helpful. We should be reporting this error during the flush
      operation.
      
      This patch does the following:
      
      1) changes cifs_fsync to use filemap_write_and_wait and cifs_flush and also
      sync to check its return code. If it returns successful, they then check
      the value of write_behind_rc to see if an earlier flush had reported any
      errors. If so, they return that error and clear write_behind_rc.
      
      2) sets write_behind_rc in a few other places where pages are written
      out as a side effect of other operations and the code waits on them.
      
      3) changes cifs_setattr to only call filemap_write_and_wait for
      ATTR_SIZE changes.
      
      4) makes cifs_writepages accurately distinguish between EIO and ENOSPC
      errors when writing out pages.
      
      Some simple testing indicates that the patch works as expected and that
      it fixes the reproduceable known problem.
      Acked-by: NDave Kleikamp <shaggy@austin.rr.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      cea21805
  25. 03 11月, 2007 2 次提交
  26. 18 10月, 2007 1 次提交
  27. 17 10月, 2007 1 次提交
  28. 12 10月, 2007 1 次提交