Hugh Dickins 5f30fc94ca lib/radix-tree.c: swapoff tmpfs radix_tree: remember to rcu_read_unlock
Running fsx on tmpfs with concurrent memhog-swapoff-swapon, lots of

  BUG: sleeping function called from invalid context at kernel/fork.c:606
  in_atomic(): 0, irqs_disabled(): 0, pid: 1394, name: swapoff
  1 lock held by swapoff/1394:
   #0:  (rcu_read_lock){.+.+.+}, at: [<ffffffff812520a1>] radix_tree_locate_item+0x1f/0x2b6

followed by

  ================================================
  [ BUG: lock held when returning to user space! ]
  3.14.0-rc1 #3 Not tainted
  ------------------------------------------------
  swapoff/1394 is leaving the kernel with locks still held!
  1 lock held by swapoff/1394:
   #0:  (rcu_read_lock){.+.+.+}, at: [<ffffffff812520a1>] radix_tree_locate_item+0x1f/0x2b6

after which the system recovered nicely.

Whoops, I long ago forgot the rcu_read_unlock() on one unlikely branch.

Fixes e504f3fdd63d ("tmpfs radix_tree: locate_item to speed up swapoff")

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-03-04 07:55:47 -08:00
..
2013-09-10 13:03:41 -07:00
2013-03-13 15:21:48 -07:00
2011-03-11 14:25:50 +00:00
2008-06-06 11:29:10 -07:00
2013-07-09 10:33:30 -07:00
2011-10-29 21:20:22 +02:00
2007-07-17 10:23:04 -07:00
2007-05-10 18:24:13 +02:00
2011-03-31 11:26:23 -03:00
2013-02-27 19:10:09 -08:00
2012-10-06 03:04:57 +09:00
2012-10-09 16:22:40 +09:00
2013-06-18 13:48:45 +02:00
2012-07-30 17:25:16 -07:00
2012-01-31 23:19:47 +02:00
2013-04-29 18:28:42 -07:00