1. 07 1月, 2011 2 次提交
  2. 08 12月, 2010 1 次提交
  3. 07 12月, 2010 1 次提交
  4. 03 12月, 2010 1 次提交
    • S
      cifs: add attribute cache timeout (actimeo) tunable · 6d20e840
      Suresh Jayaraman 提交于
      Currently, the attribute cache timeout for CIFS is hardcoded to 1 second. This
      means that the client might have to issue a QPATHINFO/QFILEINFO call every 1
      second to verify if something has changes, which seems too expensive. On the
      other hand, if the timeout is hardcoded to a higher value, workloads that
      expect strict cache coherency might see unexpected results.
      
      Making attribute cache timeout as a tunable will allow us to make a tradeoff
      between performance and cache metadata correctness depending on the
      application/workload needs.
      
      Add 'actimeo' tunable that can be used to tune the attribute cache timeout.
      The default timeout is set to 1 second. Also, display actimeo option value in
      /proc/mounts.
      
      It appears to me that 'actimeo' and the proposed (but not yet merged)
      'strictcache' option cannot coexist, so care must be taken that we reset the
      other option if one of them is set.
      
      Changes since last post:
         - fix option parsing and handle possible values correcly
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      6d20e840
  5. 30 11月, 2010 2 次提交
  6. 11 11月, 2010 1 次提交
  7. 09 11月, 2010 1 次提交
    • S
      cifs: fix a memleak in cifs_setattr_nounix() · 3565bd46
      Suresh Jayaraman 提交于
      Andrew Hendry reported a kmemleak warning in 2.6.37-rc1 while editing a
      text file with gedit over cifs.
      
      unreferenced object 0xffff88022ee08b40 (size 32):
        comm "gedit", pid 2524, jiffies 4300160388 (age 2633.655s)
        hex dump (first 32 bytes):
          5c 2e 67 6f 75 74 70 75 74 73 74 72 65 61 6d 2d  \.goutputstream-
          35 42 41 53 4c 56 00 de 09 00 00 00 2c 26 78 ee  5BASLV......,&x.
        backtrace:
          [<ffffffff81504a4d>] kmemleak_alloc+0x2d/0x60
          [<ffffffff81136e13>] __kmalloc+0xe3/0x1d0
          [<ffffffffa0313db0>] build_path_from_dentry+0xf0/0x230 [cifs]
          [<ffffffffa031ae1e>] cifs_setattr+0x9e/0x770 [cifs]
          [<ffffffff8115fe90>] notify_change+0x170/0x2e0
          [<ffffffff81145ceb>] sys_fchmod+0x10b/0x140
          [<ffffffff8100c172>] system_call_fastpath+0x16/0x1b
          [<ffffffffffffffff>] 0xffffffffffffffff
      
      The commit 1025774c that removed inode_setattr() seems to have introduced this
      memleak by returning early without freeing 'full_path'.
      Reported-by: NAndrew Hendry <andrew.hendry@gmail.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      3565bd46
  8. 25 10月, 2010 1 次提交
  9. 12 10月, 2010 1 次提交
  10. 08 10月, 2010 1 次提交
  11. 07 10月, 2010 3 次提交
  12. 30 9月, 2010 5 次提交
  13. 09 9月, 2010 1 次提交
  14. 27 8月, 2010 1 次提交
    • S
      Cannot allocate memory error on mount · f0138a79
      Suresh Jayaraman 提交于
      On 08/26/2010 01:56 AM, joe hefner wrote:
      > On a recent Fedora (13), I am seeing a mount failure message that I can not explain. I have a Windows Server 2003ýa with a share set up for access only for a specific username (say userfoo). If I try to mount it from Linux,ýusing userfoo and the correct password all is well. If I try with a bad password or with some other username (userbar), it fails with "Permission denied" as expected. If I try to mount as username = administrator, and give the correct administrator password, I would also expect "Permission denied", but I see "Cannot allocate memory" instead.
      
      > ýfs/cifs/netmisc.c: Mapping smb error code 5 to POSIX err -13
      > ýfs/cifs/cifssmb.c: Send error in QPathInfo = -13
      > ýCIFS VFS: cifs_read_super: get root inode failed
      
      Looks like the commit 0b8f18e3 assumed that cifs_get_inode_info() and
      friends fail only due to memory allocation error when the inode is NULL
      which is not the case if CIFSSMBQPathInfo() fails and returns an error.
      Fix this by propagating the actual error code back.
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      f0138a79
  15. 10 8月, 2010 3 次提交
    • C
      cifs: truncate fallout · 1b947463
      Christoph Hellwig 提交于
      Remove the calls to inode_newsize_ok given that we already did it as
      part of inode_change_ok in the beginning of cifs_setattr_(no)unix.
      
      No need to call ->truncate if cifs doesn't have one, so remove the
      explicit call in cifs_vmtruncate, and replace the calls to vmtruncate
      with truncate_setsize which is vmtruncate minus inode_newsize_ok
      and the call to ->truncate.
      
      Rename cifs_vmtruncate to cifs_setsize to match the new calling conventions.
      
      Question 1:  why does cifs do the pagecache munging and i_size update twice
      	for each setattr call, once opencoded in cifs_vmtruncate, and once
      	using the VFS helpers?
      Question 2: what is supposed to be protected by i_lock in cifs_vmtruncate?
      	Do we need it around the call to inode_change_ok?
      
      [AV: fixed build breakage]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1b947463
    • C
      always call inode_change_ok early in ->setattr · db78b877
      Christoph Hellwig 提交于
      Make sure we call inode_change_ok before doing any changes in ->setattr,
      and make sure to call it even if our fs wants to ignore normal UNIX
      permissions, but use the ATTR_FORCE to skip those.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      db78b877
    • C
      remove inode_setattr · 1025774c
      Christoph Hellwig 提交于
      Replace inode_setattr with opencoded variants of it in all callers.  This
      moves the remaining call to vmtruncate into the filesystem methods where it
      can be replaced with the proper truncate sequence.
      
      In a few cases it was obvious that we would never end up calling vmtruncate
      so it was left out in the opencoded variant:
      
       spufs: explicitly checks for ATTR_SIZE earlier
       btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
       ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above
      
      In addition to that ncpfs called inode_setattr with handcrafted iattrs,
      which allowed to trim down the opencoded variant.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1025774c
  16. 06 8月, 2010 1 次提交
  17. 02 8月, 2010 5 次提交
  18. 12 6月, 2010 1 次提交
  19. 18 5月, 2010 3 次提交
  20. 12 5月, 2010 1 次提交
    • J
      cifs: guard against hardlinking directories · 3d694380
      Jeff Layton 提交于
      When we made serverino the default, we trusted that the field sent by the
      server in the "uniqueid" field was actually unique. It turns out that it
      isn't reliably so.
      
      Samba, in particular, will just put the st_ino in the uniqueid field when
      unix extensions are enabled. When a share spans multiple filesystems, it's
      quite possible that there will be collisions. This is a server bug, but
      when the inodes in question are a directory (as is often the case) and
      there is a collision with the root inode of the mount, the result is a
      kernel panic on umount.
      
      Fix this by checking explicitly for directory inodes with the same
      uniqueid. If that is the case, then we can assume that using server inode
      numbers will be a problem and that they should be disabled.
      
      Fixes Samba bugzilla 7407
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      CC: Stable <stable@kernel.org>
      Reviewed-and-Tested-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      3d694380
  21. 21 4月, 2010 2 次提交
    • S
      f19159dc
    • J
      [CIFS] Neaten cERROR and cFYI macros, reduce text space · b6b38f70
      Joe Perches 提交于
      Neaten cERROR and cFYI macros, reduce text space
      ~2.5K
      
      Convert '__FILE__ ": " fmt' to '"%s: " fmt', __FILE__' to save text space
      Surround macros with do {} while
      Add parentheses to macros
      Make statement expression macro from macro with assign
      Remove now unnecessary parentheses from cFYI and cERROR uses
      
      defconfig with CIFS support old
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       156012	   1760	    148	 157920	  268e0	fs/cifs/built-in.o
      
      defconfig with CIFS support old
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       153508	   1760	    148	 155416	  25f18	fs/cifs/built-in.o
      
      allyesconfig old:
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       309138	   3864	  74824	 387826	  5eaf2	fs/cifs/built-in.o
      
      allyesconfig new
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       305655	   3864	  74824	 384343	  5dd57	fs/cifs/built-in.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      b6b38f70
  22. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  23. 10 3月, 2010 1 次提交