1. 31 12月, 2007 2 次提交
    • J
      [CIFS] redo existing session setup if needed in cifs_mount · 1d9a8852
      Jeff Layton 提交于
      When cifs_mount finds an existing SMB session that it can use for a new
      mount, it does not check to see whether that session is in need of being
      reconnected. An easy way to reproduce:
      
      1) mount //server/share1
      2) watch /proc/fs/cifs/DebugData for the share to go DISCONNECTED
      3) mount //server/share2 with same creds as in step 1.
      
      The second mount will fail because CIFSTCon returned -EAGAIN. If you do
      an operation in share1 and then reattempt the mount it will work (since
      the session is reestablished).
      
      The following patch fixes this by having cifs_mount check the status
      of the session when it picks an existing session and calling
      cifs_setup_session on it again if it's in need of reconnection.
      
      Thanks to Wojciech Pilorz for the initial bug report.
      Signed-off-by: NJeff Layton <jlayton@tupile.poochiereds.net>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      1d9a8852
    • S
      [CIFS] fix SetEA failure to some Samba versions · dae5dbdb
      Steve French 提交于
      Thanks to Oleg Gvozdev for noticing the problem.
      
      CC: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      dae5dbdb
  2. 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
  3. 17 11月, 2007 1 次提交
  4. 10 11月, 2007 1 次提交
    • J
      [CIFS] fix oops on second mount to same server when null auth is used · 9b8f5f57
      Jeff Layton 提交于
      When a share is mounted using no username, cifs_mount sets
      volume_info.username as a NULL pointer, and the sesInfo userName as an
      empty string. The volume_info.username is passed to a couple of other
      functions to see if there is an existing unc or tcp connection that can
      be used. These functions assume that the username will be a valid
      string that can be passed to strncmp. If the pointer is NULL, then the
      kernel will oops if there's an existing session to which the string
      can be compared.
      
      This patch changes cifs_mount to set volume_info.username to an empty
      string in this situation, which prevents the oops and should make it
      so that the comparison to other null auth sessions match.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      9b8f5f57
  5. 09 11月, 2007 1 次提交
  6. 01 11月, 2007 1 次提交
    • S
      [CIFS] when mount helper missing fix slash wrong direction in share · 1fb64bfc
      Steve French 提交于
      Kernel bugzilla bug #9228
      
      If mount helper (mount.cifs) missing, mounts with form like
      //10.11.12.13/c$ would not work (only mounts with slash e.g.
      //10.11.12.13\\c$ would work) due to problem with slash supposed
      to be converted to backslash by the mount helper (which is not
      there).
      
      If we fail on converting an IPv4 address in in4_pton then
      try to canonicalize the first slash (ie between sharename
      and host ip address) if necessary.  If we have to retry
      to check for IPv6 address the slash is already converted
      if necessary.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      1fb64bfc
  7. 30 10月, 2007 1 次提交
  8. 18 10月, 2007 2 次提交
  9. 15 10月, 2007 1 次提交
  10. 12 10月, 2007 1 次提交
  11. 29 9月, 2007 1 次提交
  12. 28 9月, 2007 1 次提交
  13. 24 8月, 2007 1 次提交
  14. 26 7月, 2007 1 次提交
  15. 15 7月, 2007 1 次提交
    • S
      [CIFS] Add support for new POSIX unlink · 2d785a50
      Steve French 提交于
      In the cleanup phase of the dbench test, we were noticing sharing
      violation followed by failed directory removals when dbench
      did not close the test files before the cleanup phase started.
      Using the new POSIX unlink, which Samba has supported for a few
      months, avoids this.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      2d785a50
  16. 12 7月, 2007 1 次提交
  17. 09 7月, 2007 1 次提交
  18. 07 7月, 2007 1 次提交
  19. 25 6月, 2007 1 次提交
  20. 05 5月, 2007 1 次提交
    • J
      [CIFS] Make sec=none force an anonymous mount · 8426c39c
      Jeff Layton 提交于
      We had a customer report that attempting to make CIFS mount with a null
      username (i.e. doing an anonymous mount) doesn't work. Looking through the
      code, it looks like CIFS expects a NULL username from userspace in order
      to trigger an anonymous mount. The mount.cifs code doesn't seem to ever
      pass a null username to the kernel, however.
      
      It looks also like the kernel can take a sec=none option, but it only seems
      to look at it if the username is already NULL. This seems redundant and
      effectively makes sec=none useless.
      
      The following patch makes sec=none force an anonymous mount.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      8426c39c
  21. 01 5月, 2007 1 次提交
    • S
      [CIFS] UID/GID override on CIFS mounts to Samba · 4523cc30
      Steve French 提交于
      When CIFS Unix Extensions are negotiated we get the Unix uid and gid
      owners of the file from the server (on the Unix Query Path Info
      levels), but if the server's uids don't match the client uid's users
      were having to disable the Unix Extensions (which turned off features
      they still wanted).   The changeset patch allows users to override uid
      and/or gid for file/directory owner with a default uid and/or gid
      specified at mount (as is often done when mounting from Linux cifs
      client to Windows server).  This changeset also displays the uid
      and gid used by default in /proc/mounts (if applicable).
      
      Also cleans up code by adding some of the missing spaces after
      "if" keywords per-kernel style guidelines (as suggested by Randy Dunlap
      when he reviewed the patch).
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      4523cc30
  22. 25 4月, 2007 1 次提交
    • S
      [CIFS] Add IPv6 support · 5858ae44
      Steve French 提交于
      IPv6 support was started a few years ago in the cifs client, but lacked a
      kernel helper function for parsing the ascii form of the ipv6 address. Now
      that that is added (and now IPv6 is the default that some OS use now) it
      was fairly easy to finish  the cifs ipv6 support.  This  requires that
      CIFS_EXPERIMENTAL be enabled and (at least until the mount.cifs module is
      modified to use a new ipv6 friendly call instead of gethostbyname) and the
      ipv6 address be passed on the mount as "ip=" mount option.
      
      Thanks
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      5858ae44
  23. 24 4月, 2007 1 次提交
  24. 07 4月, 2007 1 次提交
  25. 23 3月, 2007 1 次提交
  26. 10 3月, 2007 1 次提交
  27. 06 3月, 2007 1 次提交
  28. 27 2月, 2007 1 次提交
  29. 14 2月, 2007 1 次提交
  30. 09 2月, 2007 1 次提交
  31. 07 2月, 2007 1 次提交
  32. 24 12月, 2006 1 次提交
  33. 08 12月, 2006 1 次提交
  34. 02 11月, 2006 1 次提交
  35. 31 10月, 2006 1 次提交
  36. 21 9月, 2006 1 次提交
  37. 17 8月, 2006 1 次提交
  38. 15 8月, 2006 1 次提交