[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block: complete all IOs before .bdrv_truncate
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] block: complete all IOs before .bdrv_truncate |
Date: |
Mon, 18 Feb 2013 13:49:43 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
Il 18/02/2013 13:48, Peter Lieven ha scritto:
> bdrv_truncate() invalidates the bdrv_check_request() result for
> in-flight requests, so there should better be none.
>
> Signed-off-by: Peter Lieven <address@hidden>
> Reported-by: Kevin Wolf <address@hidden>
> ---
> block.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/block.c b/block.c
> index 50dab8e..d8880e3 100644
> --- a/block.c
> +++ b/block.c
> @@ -2427,6 +2427,10 @@ int bdrv_truncate(BlockDriverState *bs, int64_t
> offset)
> return -EACCES;
> if (bdrv_in_use(bs))
> return -EBUSY;
> +
> + /* there should be better no IOs in flight when we truncate the
> device */
> + bdrv_drain_all();
> +
> ret = drv->bdrv_truncate(bs, offset);
> if (ret == 0) {
> ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);
Cc: address@hidden
Reviewed-by: Paolo Bonzini <address@hidden>
- Re: [Qemu-devel] [PATCH] iscsi: add iscsi_truncate support, (continued)
- Re: [Qemu-devel] [PATCH] iscsi: add iscsi_truncate support, Paolo Bonzini, 2013/02/15
- Re: [Qemu-devel] [PATCH] iscsi: add iscsi_truncate support, Peter Lieven, 2013/02/15
- Re: [Qemu-devel] [PATCH] iscsi: add iscsi_truncate support, Paolo Bonzini, 2013/02/15
- Re: [Qemu-devel] [PATCH] iscsi: add iscsi_truncate support, Peter Lieven, 2013/02/15
- Re: [Qemu-devel] [PATCH] iscsi: add iscsi_truncate support, Kevin Wolf, 2013/02/15
- Re: [Qemu-devel] [PATCH] iscsi: add iscsi_truncate support, Peter Lieven, 2013/02/15
- Re: [Qemu-devel] [PATCH] iscsi: add iscsi_truncate support, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCHv2] iscsi: add iscsi_truncate support, Peter Lieven, 2013/02/15
- Re: [Qemu-devel] [PATCHv2] iscsi: add iscsi_truncate support, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH] block: complete all IOs before .bdrv_truncate, Peter Lieven, 2013/02/18
- Re: [Qemu-devel] [PATCH] block: complete all IOs before .bdrv_truncate,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH] block: complete all IOs before .bdrv_truncate, Kevin Wolf, 2013/02/20
- Re: [Qemu-devel] [PATCH] block: complete all IOs before .bdrv_truncate, Eric Blake, 2013/02/18
- [Qemu-devel] [PATCHv3] iscsi: add iscsi_truncate support, Peter Lieven, 2013/02/18
- Re: [Qemu-devel] [PATCHv3] iscsi: add iscsi_truncate support, Paolo Bonzini, 2013/02/18
- Re: [Qemu-devel] [PATCHv3] iscsi: add iscsi_truncate support, Peter Lieven, 2013/02/18
- Re: [Qemu-devel] [PATCHv3] iscsi: add iscsi_truncate support, Paolo Bonzini, 2013/02/18
- [Qemu-devel] [PATCHv4] iscsi: add iscsi_truncate support, Peter Lieven, 2013/02/18
- Re: [Qemu-devel] [PATCHv4] iscsi: add iscsi_truncate support, Paolo Bonzini, 2013/02/25