block: fix loop on blk_drain_queue when __dm_destroy
author黄涛 <huangtao@rock-chips.com>
Sat, 23 Mar 2013 01:24:16 +0000 (09:24 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sat, 23 Mar 2013 01:32:38 +0000 (09:32 +0800)
when install apk to sdcard, vold will loop on blk_drain_queue:
vold            D c090e3a8     0   119      1 0x00000000
[<c090e3a8>] (__schedule+0x3b0/0x85c) from [<c090ed98>] (schedule_timeout+0x160/0x2dc)
[<c090ed98>] (schedule_timeout+0x160/0x2dc) from [<c047de38>] (msleep+0x14/0x20)
[<c047de38>] (msleep+0x14/0x20) from [<c05e6e04>] (blk_cleanup_queue+0xb4/0x218)
[<c05e6e04>] (blk_cleanup_queue+0xb4/0x218) from [<c071cca4>] (__dm_destroy+0x170/0x1c4)
[<c071cca4>] (__dm_destroy+0x170/0x1c4) from [<c0721d8c>] (dev_remove+0x74/0xa8)
[<c0721d8c>] (dev_remove+0x74/0xa8) from [<c0722534>] (dm_ctl_ioctl+0x1e4/0x2d4)
[<c0722534>] (dm_ctl_ioctl+0x1e4/0x2d4) from [<c05153c4>] (do_vfs_ioctl+0x80/0x5b0)
[<c05153c4>] (do_vfs_ioctl+0x80/0x5b0) from [<c051592c>] (sys_ioctl+0x38/0x60)
[<c051592c>] (sys_ioctl+0x38/0x60) from [<c0439540>] (ret_fast_syscall+0x0/0x30)

block/blk-core.c

index 829da3295798e5e203c43d024f610bf51a863bb7..17db3c410518677d804cd1d2feb23bc6348383c0 100755 (executable)
@@ -377,7 +377,7 @@ static void blk_drain_queue(struct request_queue *q)
                 * multiple places and there's no single counter which can
                 * be drained.  Check all the queues and counters.
                 */
-               drain |= !list_empty(&q->queue_head);
+//             drain |= !list_empty(&q->queue_head);
                for (i = 0; i < 2; i++) {
                        drain |= q->rq.count[i];
                        drain |= q->in_flight[i];