[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH] block/io.c: Flush parent for quorum in generic code
From: |
Stefan Hajnoczi |
Subject: |
Re: [RFC PATCH] block/io.c: Flush parent for quorum in generic code |
Date: |
Thu, 13 May 2021 15:25:46 +0100 |
On Wed, May 12, 2021 at 03:49:57PM +0800, Zhang Chen wrote:
> Fix the issue from this patch:
> [PATCH] block: Flush all children in generic code
> From 883833e29cb800b4d92b5d4736252f4004885191
>
> Quorum driver do not have the primary child.
> It will caused guest block flush issue when use quorum and NBD.
> The vm guest flushes failed,and then guest filesystem is shutdown.
>
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> Reported-by: Minghao Yuan <meeho@qq.com>
> ---
> block/io.c | 31 ++++++++++++++++++++++---------
> 1 file changed, 22 insertions(+), 9 deletions(-)
...
> +flush_data:
> + if (no_primary_child) {
> + /* Flush parent */
> + ret = bs->file ? bdrv_co_flush(bs->file->bs) : 0;
> + } else {
> + /* Flush childrens */
> + ret = 0;
> + QLIST_FOREACH(child, &bs->children, next) {
> + if (child->perm & (BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED)) {
> + int this_child_ret = bdrv_co_flush(child->bs);
> + if (!ret) {
> + ret = this_child_ret;
> + }
> }
> }
I'm missing something:
The quorum driver has a valid bs->children list even though it does not
have a primary child. Why does QLIST_FOREACH() loop fail for you?
Does this patch effectively skip bdrv_co_flush() calls on all quorum
children? That seems wrong since children need to be flushed so that
data is persisted.
Stefan
signature.asc
Description: PGP signature