kernel-ark/block
Tejun Heo 4eabc94125 block: don't kick empty queue in blk_drain_queue()
While probing, fd sets up queue, probes hardware and tears down the
queue if probing fails.  In the process, blk_drain_queue() kicks the
queue which failed to finish initialization and fd is unhappy about
that.

  floppy0: no floppy controllers found
  ------------[ cut here ]------------
  WARNING: at drivers/block/floppy.c:2929 do_fd_request+0xbf/0xd0()
  Hardware name: To Be Filled By O.E.M.
  VFS: do_fd_request called on non-open device
  Modules linked in:
  Pid: 1, comm: swapper Not tainted 3.2.0-rc4-00077-g5983fe2 #2
  Call Trace:
   [<ffffffff81039a6a>] warn_slowpath_common+0x7a/0xb0
   [<ffffffff81039b41>] warn_slowpath_fmt+0x41/0x50
   [<ffffffff813d657f>] do_fd_request+0xbf/0xd0
   [<ffffffff81322b95>] blk_drain_queue+0x65/0x80
   [<ffffffff81322c93>] blk_cleanup_queue+0xe3/0x1a0
   [<ffffffff818a809d>] floppy_init+0xdeb/0xe28
   [<ffffffff818a72b2>] ? daring+0x6b/0x6b
   [<ffffffff810002af>] do_one_initcall+0x3f/0x170
   [<ffffffff81884b34>] kernel_init+0x9d/0x11e
   [<ffffffff810317c2>] ? schedule_tail+0x22/0xa0
   [<ffffffff815dbb14>] kernel_thread_helper+0x4/0x10
   [<ffffffff81884a97>] ? start_kernel+0x2be/0x2be
   [<ffffffff815dbb10>] ? gs_change+0xb/0xb

Avoid it by making blk_drain_queue() kick queue iff dispatch queue has
something on it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Ralf Hildebrandt <Ralf.Hildebrandt@charite.de>
Reported-by: Wu Fengguang <fengguang.wu@intel.com>
Tested-by: Sergei Trofimovich <slyich@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2011-12-15 20:03:04 +01:00
..
blk-cgroup.c blk-throttle: Take blkcg->lock while traversing blkcg->policy_list 2011-10-25 15:48:12 +02:00
blk-cgroup.h block: fix a typo in the blk-cgroup.h file 2011-10-24 16:08:38 +02:00
blk-core.c block: don't kick empty queue in blk_drain_queue() 2011-12-15 20:03:04 +01:00
blk-exec.c
blk-flush.c blk-flush: move the queue kick into 2011-10-24 16:24:31 +02:00
blk-integrity.c block: add export.h to files using EXPORT_SYMBOL/THIS_MODULE macros 2011-10-31 19:31:12 -04:00
blk-ioc.c
blk-iopoll.c
blk-lib.c
blk-map.c block: Always check length of all iov entries in blk_rq_map_user_iov() 2011-11-13 19:58:09 +01:00
blk-merge.c
blk-settings.c
blk-softirq.c
blk-sysfs.c block: fix request_queue lifetime handling by making blk_queue_cleanup() properly shutdown 2011-10-19 14:42:16 +02:00
blk-tag.c block: warn if tag is greater than real_max_depth. 2011-10-25 10:20:05 +02:00
blk-throttle.c blk-throttle: use queue_is_locked() instead of lockdep_is_held() 2011-10-25 15:51:48 +02:00
blk-timeout.c
blk.h block: fix request_queue lifetime handling by making blk_queue_cleanup() properly shutdown 2011-10-19 14:42:16 +02:00
bsg-lib.c block: Change module.h -> export.h in bsg-lib.c 2011-10-31 19:31:13 -04:00
bsg.c
cfq-iosched.c cfq-iosched: fix cfq_cic_link() race confition 2011-12-02 10:07:07 +01:00
cfq.h
compat_ioctl.c
deadline-iosched.c
elevator.c block: fix request_queue lifetime handling by making blk_queue_cleanup() properly shutdown 2011-10-19 14:42:16 +02:00
genhd.c block: Revert "[SCSI] genhd: add a new attribute "alias" in gendisk" 2011-11-10 09:03:55 +01:00
ioctl.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
Kconfig
Kconfig.iosched
Makefile
noop-iosched.c
scsi_ioctl.c block: drop unnecessary blk_get/put_queue() in scsi_cmd_ioctl() and blk_get_tg() 2011-10-19 14:31:25 +02:00