1. 09 7月, 2009 1 次提交
  2. 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
  3. 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
  4. 24 5月, 2009 1 次提交
    • S
      [CIFS] Avoid open on possible directories since Samba now rejects them · 8db14ca1
      Steve French 提交于
      Small change (mostly formatting) to limit lookup based open calls to
      file create only.
      
      After discussion yesteday on samba-technical about the posix lookup
      regression,  and looking at a problem with cifs posix open to one
      particular Samba version, Jeff and JRA realized that Samba server's
      behavior changed in this area (posix open behavior on files vs.
      directories).   To make this behavior consistent, JRA just made a
      fix to Samba server to alter how it handles open of directories (now
      returning the equivalent of EISDIR instead of success). Since we don't
      know at lookup time whether the inode is a directory or file (and
      thus whether posix open will succeed with most current Samba server),
      this change avoids the posix open code on lookup open (just issues
      posix open on creates).    This gets the semantic benefits we want
      (atomicity, posix byte range locks, improved write semantics on newly
      created files) and file create still is fast, and we avoid the problem
      that Jeff noticed yesterday with "openat" (and some open directory
      calls) of non-cached directories to one version of Samba server, and
      will work with future Samba versions (which include the fix jra just
      pushed into Samba server).  I confirmed this approach with jra
      yesterday and with Shirish today.
      
      Posix open is only called (at lookup time) for file create now.
      For opens (rather than creates), because we do not know if it
      is a file or directory yet, and current Samba no longer allows
      us to do posix open on dirs, we could end up wasting an open call
      on what turns out to be a dir. For file opens, we wait to call posix
      open till cifs_open.  It could be added here (lookup) in the future
      but the performance tradeoff of the extra network request when EISDIR
      or EACCES is returned would have to be weighed against the 50%
      reduction in network traffic in the other paths.
      Reviewed-by: NShirish Pargaonkar <shirishp@us.ibm.com>
      Tested-by: NJeff Layton <jlayton@redhat.com>
      CC: Jeremy Allison <jra@samba.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      8db14ca1
  5. 22 5月, 2009 1 次提交
  6. 08 5月, 2009 1 次提交
  7. 17 4月, 2009 4 次提交
  8. 01 4月, 2009 1 次提交
  9. 28 3月, 2009 1 次提交
  10. 12 3月, 2009 1 次提交
  11. 21 2月, 2009 1 次提交
    • S
      [CIFS] improve posix semantics of file create · c3b2a0c6
      Steve French 提交于
      Samba server added support for a new posix open/create/mkdir operation
      a year or so ago, and we added support to cifs for mkdir to use it,
      but had not added the corresponding code to file create.
      
      The following patch helps improve the performance of the cifs create
      path (to Samba and servers which support the cifs posix protocol
      extensions).  Using Connectathon basic test1, with 2000 files, the
      performance improved about 15%, and also helped reduce network traffic
      (17% fewer SMBs sent over the wire) due to saving a network round trip
      for the SetPathInfo on every file create.
      
      It should also help the semantics (and probably the performance) of
      write (e.g. when posix byte range locks are on the file) on file
      handles opened with posix create, and adds support for a few flags
      which would have to be ignored otherwise.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      c3b2a0c6
  12. 29 1月, 2009 1 次提交
  13. 26 12月, 2008 1 次提交
  14. 14 11月, 2008 1 次提交
  15. 06 8月, 2008 2 次提交
  16. 24 5月, 2008 1 次提交
    • J
      when creating new inodes, use file_mode/dir_mode exclusively on mount without unix extensions · b0fd30d3
      Jeff Layton 提交于
      When CIFS creates a new inode on a mount without unix extensions, it
      temporarily assigns the mode that was passed to it in the create/mkdir
      call. Eventually, when the inode is revalidated, it changes to have the
      file_mode or dir_mode for the mount. This is confusing to users who
      expect that the mode shouldn't change this way. It's also problematic
      since only the mode is treated this way, not the uid or gid. Suppose you
      have a CIFS mount that's mounted with:
      
      uid=0,gid=0,file_mode=0666,dir_mode=0777
      
      ...if an unprivileged user comes along and does this on the mount:
      
      mkdir -m 0700 foo
      touch foo/bar
      
      ...there is a period of time where the touch will fail, since the dir
      will initially be owned by root and have mode 0700. If the user waits
      long enough, then "foo" will be revalidated and will get the correct
      dir_mode permissions.
      
      This patch changes cifs_mkdir and cifs_create to not overwrite the
      mode found by the initial cifs_get_inode_info call after the inode is
      created on the server. Legacy behavior can be reenabled with the
      new "dynperm" mount option.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      b0fd30d3
  17. 15 5月, 2008 2 次提交
  18. 12 5月, 2008 1 次提交
    • J
      [CIFS] when not using unix extensions, check for and set ATTR_READONLY on create and mkdir · 67750fb9
      Jeff Layton 提交于
      When creating a directory on a CIFS share without POSIX extensions,
      and the given mode has no write bits set, set the ATTR_READONLY bit.
      
      When creating a file, set ATTR_READONLY if the create mode has no write
      bits set and we're not using unix extensions.
      
      There are some comments about this being problematic due to the VFS
      splitting creates into 2 parts. I'm not sure what that's actually
      talking about, but I'm assuming that it has something to do with how
      mknod is implemented. In the simple case where we have no unix
      extensions and we're just creating a regular file, there's no reason
      we can't set ATTR_READONLY.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      67750fb9
  19. 29 4月, 2008 1 次提交
  20. 15 3月, 2008 1 次提交
    • S
      [CIFS] file create with acl support enabled is slow · 8b1327f6
      Steve French 提交于
      Shirish Pargaonkar noted:
      With cifsacl mount option, when a file is created on the Windows server,
      exclusive oplock is broken right away because the get cifs acl code
      again opens the file to obtain security descriptor.
      The client does not have the newly created file handle or inode in any
      of its lists yet so it does not respond to oplock break and server waits for
      its duration and then responds to the second open. This slows down file
      creation signficantly.  The fix is to pass the file descriptor to the get
      cifsacl code wherever available so that get cifs acl code does not send
      second open (NT Create ANDX) and oplock is not broken.
      
      CC: Shirish Pargaonkar <shirishp@us.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      8b1327f6
  21. 08 2月, 2008 1 次提交
  22. 20 1月, 2008 1 次提交
  23. 24 10月, 2007 1 次提交
  24. 29 9月, 2007 2 次提交
  25. 31 8月, 2007 1 次提交
  26. 19 7月, 2007 1 次提交
  27. 12 7月, 2007 1 次提交
  28. 10 7月, 2007 1 次提交
  29. 08 6月, 2007 1 次提交
    • S
      [CIFS] CIFS should honour umask · 3ce53fc4
      Steve French 提交于
      This patch makes CIFS honour a process' umask like other filesystems.
      Of course the server is still free to munge the permissions if it wants
      to; but the client will send the "right" permissions to begin with.
      
      A few caveats:
      
      1) It only applies to filesystems that have CAP_UNIX (aka support unix
      extensions)
      2) It applies the correct mode to the follow up CIFSSMBUnixSetPerms()
      after remote creation
      
      When mode to CIFS/NTFS ACL mapping is complete we can do the
      same thing for that case for servers which do not
      support the Unix Extensions.
      Signed-off-by: NMatt Keenen <matt@opcode-solutions.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      3ce53fc4
  30. 06 6月, 2007 2 次提交
  31. 03 5月, 2007 1 次提交
  32. 27 2月, 2007 1 次提交
  33. 21 9月, 2006 1 次提交