1. 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
  2. 22 3月, 2010 1 次提交
    • J
      NFS: don't try to decode GETATTR if DELEGRETURN returned error · 556ae3bb
      Jeff Layton 提交于
      The reply parsing code attempts to decode the GETATTR response even if
      the DELEGRETURN portion of the compound returned an error. The GETATTR
      response won't actually exist if that's the case and we're asking the
      parser to read past the end of the response.
      
      This bug is fairly benign. The parser catches this without reading past
      the end of the response and decode_getfattr returns -EIO. Earlier
      kernels however had decode_op_hdr using the READ_BUF macro, and this
      bug would make this printk pop any time the client got an error from
      a delegreturn:
      
      kernel: decode_op_hdr: reply buffer overflowed in line XXXX
      
      More recent kernels seem to have replaced this printk with a dprintk.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      556ae3bb
  3. 20 3月, 2010 1 次提交
  4. 16 3月, 2010 1 次提交
  5. 11 3月, 2010 2 次提交
    • T
      NFS: Avoid a deadlock in nfs_release_page · bb6fbc45
      Trond Myklebust 提交于
      J.R. Okajima reports the following deadlock:
      
      INFO: task kswapd0:305 blocked for more than 120 seconds.
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      kswapd0       D 0000000000000001     0   305      2 0x00000000
       ffff88001f21d4f0 0000000000000046 ffff88001fdea680 ffff88001f21c000
       ffff88001f21dfd8 ffff88001f21c000 ffff88001f21dfd8 ffff88001f21dfd8
       ffff88001fdea040 0000000000014c00 0000000000000001 ffff88001fdea040
      Call Trace:
       [<ffffffff8146155d>] io_schedule+0x4d/0x70
       [<ffffffff810d2be5>] sync_page+0x65/0xa0
       [<ffffffff81461b12>] __wait_on_bit_lock+0x52/0xb0
       [<ffffffff810d2b80>] ? sync_page+0x0/0xa0
       [<ffffffff810d2b64>] __lock_page+0x64/0x70
       [<ffffffff81070ce0>] ? wake_bit_function+0x0/0x40
       [<ffffffff810df1d4>] truncate_inode_pages_range+0x344/0x4a0
       [<ffffffff810df340>] truncate_inode_pages+0x10/0x20
       [<ffffffff8112cbfe>] generic_delete_inode+0x15e/0x190
       [<ffffffff8112cc8d>] generic_drop_inode+0x5d/0x80
       [<ffffffff8112bb88>] iput+0x78/0x80
       [<ffffffff811bc908>] nfs_dentry_iput+0x38/0x50
       [<ffffffff811285f4>] dentry_iput+0x84/0x110
       [<ffffffff811286ae>] d_kill+0x2e/0x60
       [<ffffffff8112912a>] dput+0x7a/0x170
       [<ffffffff8111e925>] path_put+0x15/0x40
       [<ffffffff811c3a44>] __put_nfs_open_context+0xa4/0xb0
       [<ffffffff811cb5d0>] ? nfs_free_request+0x0/0x50
       [<ffffffff811c3b0b>] put_nfs_open_context+0xb/0x10
       [<ffffffff811cb5f9>] nfs_free_request+0x29/0x50
       [<ffffffff81234b7e>] kref_put+0x8e/0xe0
       [<ffffffff811cb594>] nfs_release_request+0x14/0x20
       [<ffffffff811cf769>] nfs_find_and_lock_request+0x89/0xa0
       [<ffffffff811d1180>] nfs_wb_page+0x80/0x110
       [<ffffffff811c0770>] nfs_release_page+0x70/0x90
       [<ffffffff810d18ee>] try_to_release_page+0x5e/0x80
       [<ffffffff810e1178>] shrink_page_list+0x638/0x860
       [<ffffffff810e19de>] shrink_zone+0x63e/0xc40
      
      We can fix this by making the call to put_nfs_open_context() happen when we
      actually remove the write request from the inode (which is done by the
      nfsiod thread in this case).
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@kernel.org
      bb6fbc45
    • T
      NFSv4: Don't ignore the NFS_INO_REVAL_FORCED flag in nfs_revalidate_inode() · b4d2314b
      Trond Myklebust 提交于
      If the NFS_INO_REVAL_FORCED flag is set, that means that we don't yet have
      an up to date attribute cache. Even if we hold a delegation, we must
      put a GETATTR on the wire.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@kernel.org
      b4d2314b
  6. 09 3月, 2010 2 次提交
  7. 06 3月, 2010 12 次提交
  8. 04 3月, 2010 2 次提交
  9. 03 3月, 2010 7 次提交
  10. 27 2月, 2010 1 次提交
  11. 17 2月, 2010 1 次提交
    • T
      percpu: add __percpu sparse annotations to fs · 003cb608
      Tejun Heo 提交于
      Add __percpu sparse annotations to fs.
      
      These annotations are to make sparse consider percpu variables to be
      in a different address space and warn if accessed without going
      through percpu accessors.  This patch doesn't affect normal builds.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Alex Elder <aelder@sgi.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      003cb608
  12. 16 2月, 2010 1 次提交
    • C
      NFS: Too many GETATTR and ACCESS calls after direct I/O · 65d26953
      Chuck Lever 提交于
      The cached read and write paths initialize fattr->time_start in their
      setup procedures.  The value of fattr->time_start is propagated to
      read_cache_jiffies by nfs_update_inode().  Subsequent calls to
      nfs_attribute_timeout() will then use a good time stamp when
      computing the attribute cache timeout, and squelch unneeded GETATTR
      calls.
      
      Since the direct I/O paths erroneously leave the inode's
      fattr->time_start field set to zero, read_cache_jiffies for that inode
      is set to zero after any direct read or write operation.  This
      triggers an otw GETATTR or ACCESS call to update the file's attribute
      and access caches properly, even when the NFS READ or WRITE replies
      have usable post-op attributes.
      
      Make sure the direct read and write setup code performs the same fattr
      initialization as the cached I/O paths to prevent unnecessary GETATTR
      calls.
      
      This was likely introduced by commit 0e574af1 in 2.6.15, which appears
      to add new nfs_fattr_init() call sites in the cached read and write
      paths, but not in the equivalent places in fs/nfs/direct.c.  A
      subsequent commit in the same series, 33801147, introduces the
      fattr->time_start field.
      
      Interestingly, the direct write reschedule path already has a call to
      nfs_fattr_init() in the right place.
      Reported-by: NQuentin Barnes <qbarnes@yahoo-inc.com>
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Cc: stable@kernel.org
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      65d26953
  13. 10 2月, 2010 8 次提交