We find a problem of reentrant of bdrv_drain_recurse() of the same bs, which 
makes
Qemu assertion failed at

     assert(!bs_->wakeup);

in BDRV_POLL_WHILE.

To construct the problem, we do block-commit job (or others) while filling the 
space in host
file-system to make it full. The VM should be automatically paused and at the 
same time, the
block-commit job is completed. We get the following stack.

We can see in #24 calls bdrv_drain_recurse, and polls a bh of commit_complete, 
which reopen
the image and calls bdrv_drain_recurse again.

How to solve this problem?

#0  0x00007f7209e8e157 in raise () from /usr/lib64/libc.so.6
#1  0x00007f7209e8f848 in abort () from /usr/lib64/libc.so.6
#2  0x00007f7209e871c6 in __assert_fail_base () from /usr/lib64/libc.so.6
#3  0x00007f7209e87272 in __assert_fail () from /usr/lib64/libc.so.6
#4  0x00000000007bc40f in bdrv_drain_recurse (bs=0x2929ee0) at block/io.c:164
#5  0x00000000007bc6d2 in bdrv_parent_drained_begin (bs=0x295a260)
    at block/io.c:53
#6  0x00000000007bd79c in bdrv_drained_begin (bs=0x295a260) at block/io.c:248
#7  0x00000000007bc6d2 in bdrv_parent_drained_begin (bs=0x2989260)
    at block/io.c:53
#8  0x00000000007bd79c in bdrv_drained_begin (bs=0x2989260) at block/io.c:248
#9  0x00000000007bc6d2 in bdrv_parent_drained_begin (bs=0x29b8260)
    at block/io.c:53
#10 0x00000000007bd79c in bdrv_drained_begin (bs=0x29b8260) at block/io.c:248
#11 0x00000000007bc6d2 in bdrv_parent_drained_begin (bs=0x29e6250)
    at block/io.c:53
#12 0x00000000007bd79c in bdrv_drained_begin (bs=0x29e6250) at block/io.c:248
#13 0x00000000007bc6d2 in bdrv_parent_drained_begin (bs=0x2a44260)
    at block/io.c:53
#14 0x00000000007bd79c in bdrv_drained_begin (bs=0x2a44260) at block/io.c:248
#15 0x00000000007bc6d2 in bdrv_parent_drained_begin (bs=0x2a73260)
    at block/io.c:53
#16 0x00000000007bd2f3 in bdrv_drain_all_begin () at block/io.c:325
#17 0x0000000000768de2 in bdrv_reopen_multiple (ctx=0x290fdb0,
    bs_queue=bs_queue@entry=0x2bbe580, errp=errp@entry=0x7fff9667ef58)
    at block.c:2098
#18 0x000000000076a8d2 in bdrv_reopen (bs=bs@entry=0x2a73260,
    bdrv_flags=<optimized out>, errp=errp@entry=0x0) at block.c:2143
#19 0x00000000007bb263 in commit_complete (job=0x559d160, opaque=0x7f71f8012c90)
    at block/commit.c:98
#20 0x000000000076c92d in block_job_defer_to_main_loop_bh 
(opaque=0x7f71f8129eb0)
    at blockjob.c:738
#21 0x0000000000763a6f in aio_bh_poll (ctx=ctx@entry=0x28fc610) at async.c:115
#22 0x0000000000770948 in aio_dispatch (ctx=ctx@entry=0x28fc610)
    at aio_posix.c:303
#23 0x0000000000770bf6 in aio_poll (ctx=0x28fc610, blocking=blocking@entry=true)
    at aio_posix.c:476
#24 0x00000000007bc386 in bdrv_drain_recurse (bs=0x2929ee0) at block/io.c:164
#25 0x00000000007bd840 in bdrv_drain (bs=bs@entry=0x2929ee0) at block/io.c:288
#26 0x000000000076ac87 in bdrv_set_aio_context (bs=bs@entry=0x2929ee0,
    new_context=new_context@entry=0x28fc610) at block.c:3826
#27 0x00000000007ae6c3 in blk_set_aio_context (blk=0x2929bd0,
    new_context=0x28fc610) at block/block_backend.c:1632
#28 0x0000000000493772 in virtio_blk_data_plane_stop (vdev=<optimized out>)
    at 
/home/abuild/rpmbuild/BUILD/qemu-kvm-2.8.1/hw/block/dataplane/virtio_blk.c:272
#29 0x00000000006f9913 in virtio_bus_stop_ioeventfd (bus=0x4c48940)
    at hw/virtio/virtio_bus.c:237
#30 0x00000000004cd02b in virtio_vmstate_change (opaque=0x4c489b0,
    running=<optimized out>, state=<optimized out>)
    at /home/abuild/rpmbuild/BUILD/qemu-kvm-2.8.1/hw/virtio/virtio.c:1886

Reply via email to