1. 28 4月, 2012 8 次提交
  2. 29 3月, 2012 1 次提交
  3. 21 3月, 2012 2 次提交
  4. 27 7月, 2011 1 次提交
  5. 20 7月, 2011 1 次提交
  6. 12 3月, 2011 2 次提交
  7. 26 1月, 2011 1 次提交
    • C
      NFS: Fix "kernel BUG at fs/aio.c:554!" · 839f7ad6
      Chuck Lever 提交于
      Nick Piggin reports:
      
      > I'm getting use after frees in aio code in NFS
      >
      > [ 2703.396766] Call Trace:
      > [ 2703.396858]  [<ffffffff8100b057>] ? native_sched_clock+0x27/0x80
      > [ 2703.396959]  [<ffffffff8108509e>] ? put_lock_stats+0xe/0x40
      > [ 2703.397058]  [<ffffffff81088348>] ? lock_release_holdtime+0xa8/0x140
      > [ 2703.397159]  [<ffffffff8108a2a5>] lock_acquire+0x95/0x1b0
      > [ 2703.397260]  [<ffffffff811627db>] ? aio_put_req+0x2b/0x60
      > [ 2703.397361]  [<ffffffff81039701>] ? get_parent_ip+0x11/0x50
      > [ 2703.397464]  [<ffffffff81612a31>] _raw_spin_lock_irq+0x41/0x80
      > [ 2703.397564]  [<ffffffff811627db>] ? aio_put_req+0x2b/0x60
      > [ 2703.397662]  [<ffffffff811627db>] aio_put_req+0x2b/0x60
      > [ 2703.397761]  [<ffffffff811647fe>] do_io_submit+0x2be/0x7c0
      > [ 2703.397895]  [<ffffffff81164d0b>] sys_io_submit+0xb/0x10
      > [ 2703.397995]  [<ffffffff8100307b>] system_call_fastpath+0x16/0x1b
      >
      > Adding some tracing, it is due to nfs completing the request then
      > returning something other than -EIOCBQUEUED, so aio.c
      > also completes the request.
      
      To address this, prevent the NFS direct I/O engine from completing
      async iocbs when the forward path returns an error without starting
      any I/O.
      
      This fix appears to survive ^C during both "xfstest no. 208" and "fsx
      -Z."
      
      It's likely this bug has existed for a very long while, as we are seeing
      very similar symptoms in OEL 5.  Copying stable.
      
      Cc: Stable <stable@kernel.org>
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      839f7ad6
  8. 23 11月, 2010 1 次提交
  9. 28 10月, 2010 1 次提交
  10. 31 7月, 2010 1 次提交
  11. 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
  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. 24 10月, 2009 1 次提交
    • T
      nfs: Panic when commit fails · a8b40bc7
      Terry Loftin 提交于
      Actually pass the NFS_FILE_SYNC option to the server to avoid a
      Panic in nfs_direct_write_complete() when a commit fails.
      
      At the end of an nfs write, if the nfs commit fails, all the writes
      will be rescheduled.  They are supposed to be rescheduled as NFS_FILE_SYNC
      writes, but the rpc_task structure is not completely intialized and so
      the option is not passed.  When the rescheduled writes complete, the
      return indicates that they are NFS_UNSTABLE and we try to do another
      commit.  This leads to a Panic because the commit data structure pointer
      was set to null in the initial (failed) commit attempt.
      Signed-off-by: NTerry Loftin <terry.loftin@hp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a8b40bc7
  14. 20 8月, 2009 1 次提交
  15. 12 8月, 2009 1 次提交
  16. 18 6月, 2009 3 次提交
  17. 10 7月, 2008 1 次提交
  18. 20 4月, 2008 3 次提交
  19. 26 2月, 2008 2 次提交
    • T
      NFS: Ensure that the asynchronous RPC calls complete on nfsiod. · 101070ca
      Trond Myklebust 提交于
      We want to ensure that rpc_call_ops that involve mntput() are run on nfsiod
      rather than on rpciod, so that they don't deadlock when the resulting
      umount calls rpc_shutdown_client(). Hence we specify that read, write and
      commit calls must complete on nfsiod.
      Ditto for NFSv4 open, lock, locku and close asynchronous calls.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      101070ca
    • T
      NFS: Fix a deadlock with lazy umount · 383ba719
      Trond Myklebust 提交于
      We can't allow rpc callback functions like task->tk_ops->rpc_call_prepare()
      and task->tk_ops->rpc_call_done() to call mntput() in any way, since
      that will cause a deadlock when the call to rpc_shutdown_client() attempts
      to wait on 'task' to complete.
      
      We can avoid the above deadlock by moving calls to mntput to
      task->tk_ops->rpc_release() callback, since at that time the task will be
      marked as completed, and so rpc_shutdown_client won't attempt to wait on
      it.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      383ba719
  20. 30 1月, 2008 5 次提交
  21. 13 12月, 2007 1 次提交
    • T
      Revert "NFS: Ensure we return zero if applications attempt to write zero bytes" · a5576cfa
      Trond Myklebust 提交于
      This reverts commit b9148c6b.
      
      On Wed, 12 Dec 2007 10:57:30 -0500, Chuck Lever wrote
      > commit b9148c6b should be reverted.  It was recently forward-ported
      > from some years-old patches, and is clearly not needed now.
      >
      > On Dec 11, 2007, at 5:21 PM, Adrian Bunk wrote:
      >
      >> This code became dead after commit
      >> b9148c6b
      >> (which BTW doesn't seem to have changed any behaviour) and can
      >> therefore
      >> be removed.
      >>
      >> Spotted by the Coverity checker.
      >>
      >> Signed-off-by: Adrian Bunk <bunk@kernel.org>
      >>
      >> ---
      >> --- linux-2.6/fs/nfs/direct.c.old     2007-12-02 21:54:53.000000000 +0100
      >> +++ linux-2.6/fs/nfs/direct.c 2007-12-02 21:55:10.000000000 +0100
      >> @@ -897,15 +897,12 @@ ssize_t nfs_file_direct_write(struct kio
      >>       if (!count)
      >>               goto out;       /* return 0 */
      >>
      >>       retval = -EINVAL;
      >>       if ((ssize_t) count < 0)
      >>               goto out;
      >> -     retval = 0;
      >> -     if (!count)
      >> -             goto out;
      >>
      >>       retval = nfs_sync_mapping(mapping);
      >>       if (retval)
      >>               goto out;
      >>
      >>       retval = nfs_direct_write(iocb, iov, nr_segs, pos, count);
      >>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a5576cfa
  22. 07 12月, 2007 1 次提交