From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: no-reply@sashiko.virtuozzo.com, andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v11 09/10] dm-qcow2: retry R1/R2 writeback that failed with ENOSPC
Date: Mon, 9 Nov 2026 15:39:06 +0100 [thread overview]
Message-ID: <9c123860-2491-417b-a08a-1713546a5712@virtuozzo.com> (raw)
In-Reply-To: <010701a1c0ab4520-2783c6ce-b60b-447e-8f9e-453427afd458-000000@eu-central-1.amazonses.com>
On 11/9/26 15:16, no-reply@sashiko.virtuozzo.com wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] dm-qcow2: flush gives failed R1/R2 page two retries, not one
> --
>
> commit 2997fd4391d8fcb3d55f988df71bac728d0346e1
> Author: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
>
> dm-qcow2: retry R1/R2 writeback that failed with ENOSPC
>
> This patch redirties an R1/R2 metadata page whose writeback failed with
> -ENOSPC, so the slow writeback timer retries it. It adds a flag,
> md_wb_no_retry, that qcow2_flush_deferred_activity() sets on its second
> pass to stop further redirtying. It also passes the errno of a failed
> metadata write through complete_metadata_writeback() instead of
> converting it to -EIO.
>
>> diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c
>> --- a/drivers/md/dm-qcow2-target.c
>> +++ b/drivers/md/dm-qcow2-target.c
> [ ... ]
>
>> @@ -173,7 +173,9 @@ void qcow2_flush_deferred_activity(struct qcow2_target *tgt, struct qcow2 *qcow2
>> struct md_page *md;
>> int i;
>>
>> + /* Retry R1/R2 writeback failed with ENOSPC once, then give up */
>> for (i = 0; i < 2; i++) {
>> + WRITE_ONCE(qcow2->md_wb_no_retry, i == 1);
>> if (timer_delete_sync_try(&qcow2->slow_wb_timer) != -1)
>> qcow2_slow_wb_timer_fn(&qcow2->slow_wb_timer);
> [Severity: Low]
> This isn't a functional bug, but the comment and the commit message don't
> match what the loop does.
>
> Consider a page that failed with -ENOSPC at runtime and was redirtied onto
> slow_wb_batch_list:
>
> qcow2_flush_deferred_activity()
> pass i == 0: md_wb_no_retry is false, the timer is fired and the page
> is rewritten
> clear_writeback_status()
> if (ret == -ENOSPC && !READ_ONCE(qcow2->md_wb_no_retry))
> qcow2_md_make_dirty(qcow2, md, true);
> pass i == 1: md_wb_no_retry is true, the timer is fired again and the
> page is rewritten a second time
>
> If the write in pass 0 fails with -ENOSPC again, the page is redirtied. So
> a page that had already failed gets two flush-time attempts. Only the
> failure in pass 1 is final.
>
> The code comment says "Retry R1/R2 writeback failed with ENOSPC once, then
> give up". The commit message says the flush "gives the page one more try"
> and that "A page that still fails then is not redirtied".
>
> Could the comment and the commit message be reworded to say that the flush
> makes up to two attempts, or could the loop be changed so that only one
> attempt is made?
>
Fixed the commit message.
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-09 14:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 14:01 [Devel] [PATCH hci-8.1 v11 00/10] dm-qcow2: truncate unused tail of image on suspend Alexander Ivanov
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 01/10] dm-qcow2: add qcow2_md_page_read_sync() helper Alexander Ivanov
2026-11-09 14:06 ` no-reply
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 02/10] dm-qcow2: drop duplicate prefix from QC_ERR/QC_INFO messages Alexander Ivanov
2026-11-09 14:05 ` no-reply
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 03/10] dm-qcow2: extend the file for a new refblock in allocate_cluster() Alexander Ivanov
2026-11-09 14:06 ` no-reply
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 04/10] dm-qcow2: complete wbd before ending the data qio Alexander Ivanov
2026-11-09 14:09 ` no-reply
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 05/10] dm-qcow2: flush lower md before clearing dirty bit on merge failure Alexander Ivanov
2026-11-09 14:08 ` no-reply
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 06/10] dm-qcow2: keep the dirty bit of an image that needs check Alexander Ivanov
2026-11-09 14:11 ` no-reply
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 07/10] dm-qcow2: flag the image for check if reftable relocation fails late Alexander Ivanov
2026-11-09 14:11 ` no-reply
2026-11-09 15:42 ` Konstantin Khorenko
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 08/10] dm-qcow2: leak clusters allocated for a failed L1/L2 writeback Alexander Ivanov
2026-11-09 14:14 ` no-reply
2026-11-09 14:36 ` Alexander Ivanov
2026-11-09 15:42 ` Konstantin Khorenko
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 09/10] dm-qcow2: retry R1/R2 writeback that failed with ENOSPC Alexander Ivanov
2026-11-09 14:16 ` no-reply
2026-11-09 14:39 ` Alexander Ivanov [this message]
2026-11-09 15:42 ` Konstantin Khorenko
2026-11-09 14:01 ` [Devel] [PATCH hci-8.1 v11 10/10] dm-qcow2: truncate unused tail of image on suspend Alexander Ivanov
2026-11-09 14:18 ` no-reply
2026-11-09 14:47 ` Alexander Ivanov
2026-11-09 15:42 ` Konstantin Khorenko
2026-11-09 15:42 ` [Devel] [PATCH hci-8.1 v11 00/10] " Konstantin Khorenko
2026-11-09 15:54 ` Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9c123860-2491-417b-a08a-1713546a5712@virtuozzo.com \
--to=alexander.ivanov@virtuozzo.com \
--cc=andrey.zhadchenko@virtuozzo.com \
--cc=devel@openvz.org \
--cc=no-reply@sashiko.virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.