All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Jeff Cody <jcody@redhat.com>,
	John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org, qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/2] block/mirror: Make cancel always cancel pre-READY
Date: Wed, 2 May 2018 14:35:07 +0200	[thread overview]
Message-ID: <a3590eb3-49c2-2b59-fba8-8032bbeb94ac@redhat.com> (raw)
In-Reply-To: <b61ec864-3f92-d945-af4b-d14260f23ce9@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1986 bytes --]

On 2018-05-02 01:31, Eric Blake wrote:
> On 05/01/2018 05:05 PM, Max Reitz wrote:
>> Commit b76e4458b1eb3c32e9824fe6aa51f67d2b251748 made the mirror block
>> job respect block-job-cancel's @force flag: With that flag set, it would
>> now always really cancel, even post-READY.
>>
>> Unfortunately, it had a side effect: Without that flag set, it would now
>> never cancel, not even before READY.  Considering that is an
>> incompatible change and not noted anywhere in the commit or the
>> description of block-job-cancel's @force parameter, this seems
>> unintentional and we should revert to the previous behavior, which is to
>> immediately cancel the job when block-job-cancel is called before source
>> and target are in sync (i.e. before the READY event).
>>
>> Cc: qemu-stable@nongnu.org
> 
> Actually adding that in cc on this reply.

Thanks, I knew I was going to forget...

Max

>> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1572856
>> Reported-by: Yanan Fu <yfu@redhat.com>
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>> ---
>>   block/mirror.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>
> 
>>
>> diff --git a/block/mirror.c b/block/mirror.c
>> index 7bfad6e844..003f957b12 100644
>> --- a/block/mirror.c
>> +++ b/block/mirror.c
>> @@ -874,7 +874,9 @@ static void coroutine_fn mirror_run(void *opaque)
>>           }
>>           trace_mirror_before_sleep(s, cnt, s->synced, delay_ns);
>>           block_job_sleep_ns(&s->common, delay_ns);
>> -        if (block_job_is_cancelled(&s->common) && s->common.force) {
>> +        if (block_job_is_cancelled(&s->common) &&
>> +            (!s->synced || s->common.force))
>> +        {
>>               break;
>>           }
>>           s->last_pause_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
>>
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-05-02 12:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 22:05 [Qemu-devel] [PATCH 0/2] block/mirror: Make cancel always cancel pre-READY Max Reitz
2018-05-01 22:05 ` [Qemu-devel] [PATCH 1/2] " Max Reitz
2018-05-01 23:31   ` Eric Blake
2018-05-02 12:35     ` Max Reitz [this message]
2018-05-01 22:05 ` [Qemu-devel] [PATCH 2/2] iotests: Add test for cancelling a mirror job Max Reitz
2018-05-02 14:31   ` Jeff Cody
2018-05-01 23:29 ` [Qemu-devel] [PATCH 0/2] block/mirror: Make cancel always cancel pre-READY Eric Blake
2018-05-02 14:32 ` Jeff Cody
2018-05-02 17:36 ` John Snow

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=a3590eb3-49c2-2b59-fba8-8032bbeb94ac@redhat.com \
    --to=mreitz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jcody@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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.