1. 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
  2. 26 6月, 2009 1 次提交
    • S
      cifs: Fix incorrect return code being printed in cFYI messages · 0f3bc09e
      Suresh Jayaraman 提交于
      FreeXid() along with freeing Xid does add a cifsFYI debug message that
      prints rc (return code) as well. In some code paths where we set/return
      error code after calling FreeXid(), incorrect error code is being
      printed when cifsFYI is enabled.
      
      This could be misleading in few cases. For eg.
      In cifs_open() if cifs_fill_filedata() returns a valid pointer to
      cifsFileInfo, FreeXid() prints rc=-13 whereas 0 is actually being
      returned. Fix this by setting rc before calling FreeXid().
      
      Basically convert
      
      FreeXid(xid);			rc = -ERR;
      return -ERR;		=>	FreeXid(xid);
      				return rc;
      
      [Note that Christoph would like to replace the GetXid/FreeXid
      calls, which are primarily used for debugging.  This seems
      like a good longer term goal, but although there is an
      alternative tracing facility, there are no examples yet
      available that I know of that we can use (yet) to
      convert this cifs function entry/exit logging, and for
      creating an identifier that we can use to correlate
      all dmesg log entries for a particular vfs operation
      (ie identify all log entries for a particular vfs
      request to cifs: e.g. a particular close or read or write
      or byte range lock call ... and just using the thread id
      is harder).  Eventually when a replacement
      for this is available (e.g. when NFS switches over and various
      samples to look at in other file systems) we can remove the
      GetXid/FreeXid macro but in the meantime multiple people
      use this run time configurable logging all the time
      for debugging, and Suresh's patch fixes a problem
      which made it harder to notice some low
      memory problems in the log so it is worthwhile
      to fix this problem until a better logging
      approach is able to be used]
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      0f3bc09e
  3. 29 5月, 2009 1 次提交
  4. 28 5月, 2009 2 次提交
  5. 21 4月, 2009 1 次提交
  6. 18 4月, 2009 1 次提交
  7. 17 4月, 2009 3 次提交
    • 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
    • J
      cifs: flush data on any setattr · 0f4d634c
      Jeff Layton 提交于
      We already flush all the dirty pages for an inode before doing
      ATTR_SIZE and ATTR_MTIME changes. There's another problem though -- if
      we change the mode so that the file becomes read-only then we may not
      be able to write data to it after a reconnect.
      
      Fix this by just going back to flushing all the dirty data on any
      setattr call. There are probably some cases that can be optimized out,
      but I'm not sure they're worthwhile and we need to consider them more
      carefully to make sure that we don't cause regressions if we have
      to reconnect before writeback occurs.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      0f4d634c
  8. 01 4月, 2009 1 次提交
  9. 12 3月, 2009 1 次提交
  10. 21 2月, 2009 4 次提交
  11. 29 1月, 2009 1 次提交
    • S
      [CIFS] revalidate parent inode when rmdir done within that directory · 42c24544
      Steve French 提交于
      When a search is pending of a parent directory, and a child directory
      within it is removed, we need to reset the parent directory's time
      so that we don't reuse the (now stale) search results.
      
      Thanks to Gunter Kukkukk for reporting this:
      
      > got the following failure notification on irc #samba:
      >
      > A user was updating from subversion 1.4 to 1.5, where the
      > repository is located on a samba share (independent of
      > unix extensions = Yes or No).
      > svn 1.4 did work, 1.5 does not.
      >
      > The user did a lot of stracing of subversion - and wrote a
      > testapplet to simulate the failing behaviour.
      > I've converted the C++ source to C and added some error cases.
      >
      > When using "./testdir" on a local file system, "result2"
      > is always (nil) as expected - cifs vfs behaves different here!
      >
      >   ./testdir /mnt/cifs/mounted/share
      >
      > returns a (failing) valid pointer.
      Acked-by: NDave Kleikamp <shaggy@us.ibm.com>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      42c24544
  12. 06 1月, 2009 1 次提交
    • A
      inode->i_op is never NULL · acfa4380
      Al Viro 提交于
      We used to have rather schizophrenic set of checks for NULL ->i_op even
      though it had been eliminated years ago.  You'd need to go out of your
      way to set it to NULL explicitly _and_ a bunch of code would die on
      such inodes anyway.  After killing two remaining places that still
      did that bogosity, all that crap can go away.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      acfa4380
  13. 26 12月, 2008 1 次提交
  14. 14 11月, 2008 1 次提交
  15. 04 11月, 2008 1 次提交
  16. 23 10月, 2008 1 次提交
  17. 21 10月, 2008 2 次提交
  18. 20 10月, 2008 2 次提交
  19. 17 10月, 2008 1 次提交
  20. 08 10月, 2008 1 次提交
    • S
      [CIFS] clean up error handling in cifs_unlink · 6050247d
      Steve French 提交于
      Currently, if a standard delete fails and we end up getting -EACCES
      we try to clear ATTR_READONLY and try the delete again. If that
      then fails with -ETXTBSY then we try a rename_pending_delete. We
      aren't handling other errors appropriately though.
      
      Another client could have deleted the file in the meantime and
      we get back -ENOENT, for instance. In that case we wouldn't do a
      d_drop. Instead of retrying in a separate call, simply goto the
      original call and use the error handling from that.
      
      Also, we weren't properly undoing any attribute changes that
      were done before returning an error back to the caller.
      
      CC: Jeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      6050247d
  21. 07 10月, 2008 1 次提交
  22. 25 9月, 2008 3 次提交
  23. 24 9月, 2008 3 次提交
    • S
      [CIFS] fix busy-file renames and refactor cifs_rename logic · ee2fd967
      Steve French 提交于
      Break out the code that does the actual renaming into a separate
      function and have cifs_rename call that. That function will attempt a
      path based rename first and then do a filehandle based one if it looks
      like the source is busy.
      
      The existing logic tried a path based rename first, but if we needed to
      remove the destination then it only attempted a filehandle based rename
      afterward. Not all servers support renaming by filehandle, so we need to
      always attempt path rename first and fall back to filehandle rename if
      it doesn't work.
      
      This also fixes renames of open files on windows servers (at least when
      the source and destination directories are the same).
      
      CC: Jeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ee2fd967
    • J
      cifs: add function to set file disposition · 6d22f098
      Jeff Layton 提交于
      cifs: add function to set file disposition
      
      The proper way to set the delete on close bit on an already existing
      file is to use SET_FILE_INFO with an infolevel of
      SMB_FILE_DISPOSITION_INFO. Add a function to do that and have the
      silly-rename code use it.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      6d22f098
    • J
      cifs: move rename and delete-on-close logic into helper function · a12a1ac7
      Jeff Layton 提交于
      cifs: move rename and delete-on-close logic into helper function
      
      When a file is still open on the server, we attempt to set the
      DELETE_ON_CLOSE bit and rename it to a new filename. When the
      last opener closes the file, the server should delete it.
      
      This patch moves this mechanism into a helper function and has
      the two places in cifs_unlink that do this procedure call it. It
      also fixes the open flags to be correct.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      a12a1ac7
  24. 17 9月, 2008 2 次提交
  25. 19 8月, 2008 1 次提交
  26. 14 8月, 2008 1 次提交
    • S
      [CIFS] mount of IPC$ breaks with iget patch · ad661334
      Steve French 提交于
      In looking at network named pipe support on cifs, I noticed that
      Dave Howell's iget patch:
      
          iget: stop CIFS from using iget() and read_inode()
      
      broke mounts to IPC$ (the interprocess communication share), and don't
      handle the error case (when getting info on the root inode fails).
      
      Thanks to Gunter who noted a typo in a debug line in the original
      version of this patch.
      
      CC: David Howells <dhowells@redhat.com>
      CC: Gunter Kukkukk <linux@kukkukk.com>
      CC: Stable Kernel <stable@kernel.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ad661334
  27. 07 8月, 2008 1 次提交