1. 02 10月, 2010 1 次提交
  2. 23 9月, 2010 1 次提交
  3. 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
  4. 09 2月, 2010 2 次提交
  5. 27 1月, 2010 1 次提交
  6. 15 12月, 2009 1 次提交
  7. 19 11月, 2009 1 次提交
  8. 12 11月, 2009 1 次提交
  9. 24 9月, 2009 1 次提交
  10. 22 9月, 2009 2 次提交
  11. 21 8月, 2009 1 次提交
  12. 10 8月, 2009 2 次提交
  13. 13 7月, 2009 1 次提交
  14. 18 6月, 2009 3 次提交
    • C
      lockd: Don't bother with RPC ping for NSM upcalls · 0e5c2632
      Chuck Lever 提交于
      Cut NSM upcall RPC traffic in half -- don't do a NULL call first.
      The cases where a ping would be helpful are rare.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      0e5c2632
    • C
      lockd: Update NSM state from SM_MON replies · 6c9dc425
      Chuck Lever 提交于
      When rpc.statd starts up in user space at boot time, it attempts to
      write the latest NSM local state number into
      /proc/sys/fs/nfs/nsm_local_state.
      
      If lockd.ko isn't loaded yet (as is the case in most configurations),
      that file doesn't exist, thus the kernel's NSM state remains set to
      its initial value of zero during lockd operation.
      
      This is a problem because rpc.statd and lockd use the NSM state number
      to prevent repeated lock recovery on rebooted hosts.  If lockd sends
      a zero NSM state, but then a delayed SM_NOTIFY with a real NSM state
      number is received, there is no way for lockd or rpc.statd to
      distinguish that stale SM_NOTIFY from an actual reboot.  Thus lock
      recovery could be performed after the rebooted host has already
      started reclaiming locks, and those locks will be lost.
      
      We could change /etc/init.d/nfslock so it always modprobes lockd.ko
      before starting rpc.statd.  However, if lockd.ko is ever unloaded
      and reloaded, we are back at square one, since the NSM state is not
      preserved across an unload/reload cycle.  This may happen frequently
      on clients that use automounter.  A period of NFS inactivity causes
      lockd.ko to be unloaded, and the kernel loses its NSM state setting.
      
      Instead, let's use the fact that rpc.statd plants the local system's
      NSM state in every SM_MON (and SM_UNMON) reply.  lockd performs a
      synchronous SM_MON upcall to the local rpc.statd _before_ sending its
      first NLM request to a new remote.  This would permit rpc.statd to
      provide the current NSM state to lockd, even after lockd.ko had been
      unloaded and reloaded.
      
      Note that NLMPROC_LOCK arguments are constructed before the
      nsm_monitor() call, so we have to rearrange argument construction very
      slightly to make this all work out.
      
      And, the kernel appears to treat NSM state as a u32 (see struct
      nlm_args and nsm_res).  Make nsm_local_state a u32 as well, to ensure
      we don't get bogus comparison results.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6c9dc425
    • T
  15. 07 5月, 2009 1 次提交
    • J
      lockd: fix list corruption on lockd restart · 89996df4
      J. Bruce Fields 提交于
      If lockd is signalled soon enough after restart then locks_start_grace()
      will try to re-add an entry to a list and trigger a lock corruption
      warning.
      
      Thanks to Wang Chen for the problem report and diagnosis.
      
      WARNING: at lib/list_debug.c:26 __list_add+0x27/0x5c()
      ...
      list_add corruption. next->prev should be prev (ef8fe958), but was ef8ff128.  (next=ef8ff128).
      ...
      Pid: 23062, comm: lockd Tainted: G        W  2.6.30-rc2 #3
      Call Trace:
      [<c042d5b5>] warn_slowpath+0x71/0xa0
      [<c0422a96>] ? update_curr+0x11d/0x125
      [<c044b12d>] ? trace_hardirqs_on_caller+0x18/0x150
      [<c044b270>] ? trace_hardirqs_on+0xb/0xd
      [<c051c61a>] ? _raw_spin_lock+0x53/0xfa
      [<c051c89f>] __list_add+0x27/0x5c
      [<ef8f6daa>] locks_start_grace+0x22/0x30 [lockd]
      [<ef8f34da>] set_grace_period+0x39/0x53 [lockd]
      [<c06b8921>] ? lock_kernel+0x1c/0x28
      [<ef8f3558>] lockd+0x64/0x164 [lockd]
      [<c044b12d>] ? trace_hardirqs_on_caller+0x18/0x150
      [<c04227b0>] ? complete+0x34/0x3e
      [<ef8f34f4>] ? lockd+0x0/0x164 [lockd]
      [<ef8f34f4>] ? lockd+0x0/0x164 [lockd]
      [<c043dd42>] kthread+0x45/0x6b
      [<c043dcfd>] ? kthread+0x0/0x6b
      [<c0403c23>] kernel_thread_helper+0x7/0x10
      Reported-by: NWang Chen <wangchen@cn.fujitsu.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: stable@kernel.org
      89996df4
  16. 25 4月, 2009 1 次提交
    • F
      lockd: call locks_release_private to cleanup per-filesystem state · a9e61e25
      Felix Blyakher 提交于
      For every lock request lockd creates a new file_lock object
      in nlmsvc_setgrantargs() by copying the passed in file_lock with
      locks_copy_lock(). A filesystem can attach it's own lock_operations
      vector to the file_lock. It has to be cleaned up at the end of the
      file_lock's life. However, lockd doesn't do it today, yet it
      asserts in nlmclnt_release_lockargs() that the per-filesystem
      state is clean.
      This patch fixes it by exporting locks_release_private() and adding
      it to nlmsvc_freegrantargs(), to be symmetrical to creating a
      file_lock in nlmsvc_setgrantargs().
      Signed-off-by: NFelix Blyakher <felixb@sgi.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      a9e61e25
  17. 02 4月, 2009 1 次提交
  18. 29 3月, 2009 4 次提交
  19. 19 3月, 2009 1 次提交
  20. 11 3月, 2009 1 次提交
  21. 10 2月, 2009 1 次提交
    • J
      lockd: fix regression in lockd's handling of blocked locks · 9d9b87c1
      J. Bruce Fields 提交于
      If a client requests a blocking lock, is denied, then requests it again,
      then here in nlmsvc_lock() we will call vfs_lock_file() without FL_SLEEP
      set, because we've already queued a block and don't need the locks code
      to do it again.
      
      But that means vfs_lock_file() will return -EAGAIN instead of
      FILE_LOCK_DENIED.  So we still need to translate that -EAGAIN return
      into a nlm_lck_blocked error in this case, and put ourselves back on
      lockd's block list.
      
      The bug was introduced by bde74e4b "locks: add special return
      value for asynchronous locks".
      
      Thanks to Frank van Maarseveen for the report; his original test
      case was essentially
      
      	for i in `seq 30`; do flock /nfsmount/foo sleep 10 & done
      Tested-by: NFrank van Maarseveen <frankvm@frankvm.com>
      Reported-by: NFrank van Maarseveen <frankvm@frankvm.com>
      Cc: Miklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      9d9b87c1
  22. 08 1月, 2009 2 次提交
  23. 07 1月, 2009 9 次提交