1. 29 3月, 2011 1 次提交
  2. 28 3月, 2011 1 次提交
    • D
      NOMMU: percpu should use is_vmalloc_addr(). · eac522ef
      David Howells 提交于
      per_cpu_ptr_to_phys() uses VMALLOC_START and VMALLOC_END to determine if an
      address is in the vmalloc() region or not.  This is incorrect on NOMMU as
      there is no real vmalloc() capability (vmalloc() is emulated by kmalloc()).
      
      The correct way to do this is to use is_vmalloc_addr().  This encapsulates the
      vmalloc() region test in MMU mode and just returns 0 in NOMMU mode.
      
      On FRV in NOMMU mode, the percpu compilation fails without this patch:
      
      mm/percpu.c: In function 'per_cpu_ptr_to_phys':
      mm/percpu.c:1011: error: 'VMALLOC_START' undeclared (first use in this function)
      mm/percpu.c:1011: error: (Each undeclared identifier is reported only once
      mm/percpu.c:1011: error: for each function it appears in.)
      mm/percpu.c:1012: error: 'VMALLOC_END' undeclared (first use in this function)
      mm/percpu.c:1018: warning: control reaches end of non-void function
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      eac522ef
  3. 25 3月, 2011 5 次提交
  4. 24 3月, 2011 32 次提交
  5. 23 3月, 2011 1 次提交
    • C
      sys_swapon: fix inode locking · 2130781e
      Cesar Eduardo Barros 提交于
      A conflict between 52c50567 ("mm: swap: unlock swapfile inode mutex
      before closing file on bad swapfiles") and 83ef99be ("sys_swapon:
      remove did_down variable") caused a double unlock of the inode mutex
      (once in bad_swap: before the filp_close, once at the end just before
      returning).
      
      The patch which added the extra unlock cleared did_down to avoid
      unlocking twice, but the other patch removed the did_down variable.
      
      To fix, set inode to NULL after the first unlock, since it will be used
      after that point only for the final unlock.
      
      While checking this patch, I found a path which could unlock without
      locking, in case the same inode was added as a swapfile twice. To fix,
      move the setting of the inode variable further down, to just before
      claim_swapfile, which will lock the inode before doing anything else.
      
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Eric B Munson <emunson@mgebm.net>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NCesar Eduardo Barros <cesarb@cesarb.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2130781e