blkcg: fix "scheduling while atomic" in blk_queue_bypass_start
Jun'ichi Nomura authored
commit e5072664 upstream.

Since 749fefe6 in v3.7 ("block: lift the initial queue bypass mode
on blk_register_queue() instead of blk_init_allocated_queue()"),
the following warning appears when multipath is used with CONFIG_PREEMPT=y.

This patch moves blk_queue_bypass_start() before radix_tree_preload()
to avoid the sleeping call while preemption is disabled.

  BUG: scheduling while atomic: multipath/2460/0x00000002
  1 lock held by multipath/2460:
   #0:  (&md->type_lock){......}, at: [<ffffffffa019fb05>] dm_lock_md_type+0x17/0x19 [dm_mod]
  Modules linked in: ...
  Pid: 2460, comm: multipath Tainted: G        W    3.7.0-rc2 #1
  Call Trace:
   [<ffffffff810723ae>] __schedule_bug+0x6a/0x78
   [<ffffffff81428ba2>] __schedule+0xb4/0x5e0
   [<ffffffff814291e6>] schedule+0x64/0x66
   [<ffffffff8142773a>] schedule_timeout+0x39/0xf8
   [<ffffffff8108ad5f>] ? put_lock_stats+0xe/0x29
   [<ffffffff8108ae30>] ? lock_...
ae4282fe
Name Last commit Last update
..
partitions block/partitions: optimize memory allocation in check_partition()
Kconfig block: don't select PERCPU_RWSEM
Kconfig.iosched blkcg: make CONFIG_BLK_CGROUP bool
Makefile separate partition format handling from generic code
blk-cgroup.c blkcg: fix "scheduling while atomic" in blk_queue_bypass_start
blk-cgroup.h blkcg: implement blkg_[rw]stat_recursive_sum() and blkg_[rw]stat_merge()
blk-core.c Revert "block: add missing block_bio_complete() tracepoint"
blk-exec.c Merge branch 'for-3.9/core' of git://git.kernel.dk/linux-block
blk-flush.c Block: blk-flush: Fixed indent code style
blk-integrity.c bdi: allow block devices to say that they require stable page writes
blk-ioc.c hlist: drop the node parameter from iterators
blk-iopoll.c tree-wide: fix assorted typos all over the place
blk-lib.c block: account iowait time when waiting for completion of IO request
blk-map.c block: re-use existing 'reading' variable instead of checking direction again
blk-merge.c block: Implement support for WRITE SAME
blk-settings.c block: discard granularity might not be power of 2
blk-softirq.c sched, block: Unify cache detection
blk-sysfs.c block: avoid using uninitialized value in from queue_var_store
blk-tag.c block/blk-tag.c: Remove useless kfree
blk-throttle.c block: Rename queue dead flag
blk-timeout.c block: Drop dead function blk_abort_queue()
blk.h block,elevator: use new hashtable implementation
bsg-lib.c bsg: Remove unused function bsg_goose_queue()
bsg.c hlist: drop the node parameter from iterators
cfq-iosched.c Merge branch 'for-3.9/core' of git://git.kernel.dk/linux-block
compat_ioctl.c
deadline-iosched.c
elevator.c
genhd.c
ioctl.c
noop-iosched.c
partition-generic.c
scsi_ioctl.c