[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/5] blkdebug: do not suspend in the middle of QLIST_FOREA
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 4/5] blkdebug: do not suspend in the middle of QLIST_FOREACH_SAFE |
Date: |
Fri, 7 May 2021 10:25:56 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
On 5/7/21 10:12 AM, Emanuele Giuseppe Esposito wrote:
> That would be unsafe in case a rule other than the current one
> is removed while the coroutine has yielded.
> Keep FOREACH_SAFE because suspend_request deletes the current rule.
>
> After this patch, *all* matching rules are deleted before suspending
> the coroutine, rather than just one.
> This doesn't affect the existing testcases.
>
> Use actions_count to see how many yeld to issue.
yield
>
> Co-developed-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
> block/blkdebug.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- [PATCH v2 0/5] blkdebug: fix racing condition when iterating on, Emanuele Giuseppe Esposito, 2021/05/07
- [PATCH v2 1/5] blkdebug: refactor removal of a suspended request, Emanuele Giuseppe Esposito, 2021/05/07
- [PATCH v2 2/5] blkdebug: move post-resume handling to resume_req_by_tag, Emanuele Giuseppe Esposito, 2021/05/07
- [PATCH v2 3/5] blkdebug: track all actions, Emanuele Giuseppe Esposito, 2021/05/07
- [PATCH v2 4/5] blkdebug: do not suspend in the middle of QLIST_FOREACH_SAFE, Emanuele Giuseppe Esposito, 2021/05/07
- Re: [PATCH v2 4/5] blkdebug: do not suspend in the middle of QLIST_FOREACH_SAFE,
Eric Blake <=
- [PATCH v2 5/5] blkdebug: protect rules and suspended_reqs with a lock, Emanuele Giuseppe Esposito, 2021/05/07