[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] nbd: wait all read/write requests finished when
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] nbd: wait all read/write requests finished when shutdowning nbd socket |
Date: |
Wed, 16 Sep 2015 10:35:14 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 16/09/2015 10:22, Wen Congyang wrote:
>>> >> if (exp->blk) {
>>> >> + bdrv_drain(blk_bs(exp->blk));
>>> >> blk_remove_aio_context_notifier(exp->blk, blk_aio_attached,
>>> >> blk_aio_detach, exp);
>>> >> blk_unref(exp->blk);
>> >
>> > I think a better fix is to move the whole "if" to nbd_export_put. In
>> > fact, nbd_export_close is wrong because exp can be freed by
>> > nbd_export_close's call to nbd_export_put.
> OK, I will fix it in the next version.
To be clear, the bug is pre-existing (commit 38b54b6, "nbd: use
BlockDriverState refcnt", 2013-08-23).
Paolo