All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] job.c: add missing notifier initialization
@ 2021-11-03 16:21 Emanuele Giuseppe Esposito
  2021-11-03 16:32 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Emanuele Giuseppe Esposito @ 2021-11-03 16:21 UTC (permalink / raw)
  To: qemu-block
  Cc: Emanuele Giuseppe Esposito, Vladimir Sementsov-Ogievskiy,
	John Snow, qemu-devel, Stefan Hajnoczi

It seems that on_idle list is not properly initialized like
the other notifiers.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
 job.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/job.c b/job.c
index dbfa67bb0a..54db80df66 100644
--- a/job.c
+++ b/job.c
@@ -352,6 +352,7 @@ void *job_create(const char *job_id, const JobDriver *driver, JobTxn *txn,
     notifier_list_init(&job->on_finalize_completed);
     notifier_list_init(&job->on_pending);
     notifier_list_init(&job->on_ready);
+    notifier_list_init(&job->on_idle);
 
     job_state_transition(job, JOB_STATUS_CREATED);
     aio_timer_init(qemu_get_aio_context(), &job->sleep_timer,
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] job.c: add missing notifier initialization
  2021-11-03 16:21 [PATCH v1] job.c: add missing notifier initialization Emanuele Giuseppe Esposito
@ 2021-11-03 16:32 ` Philippe Mathieu-Daudé
  2021-11-04 10:04 ` Stefan Hajnoczi
  2021-11-12 18:04 ` Vladimir Sementsov-Ogievskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-11-03 16:32 UTC (permalink / raw)
  To: Emanuele Giuseppe Esposito, qemu-block
  Cc: Vladimir Sementsov-Ogievskiy, John Snow, qemu-devel, Stefan Hajnoczi

On 11/3/21 17:21, Emanuele Giuseppe Esposito wrote:
> It seems that on_idle list is not properly initialized like
> the other notifiers.
> 

Cc: qemu-stable@nongnu.org
Fixes: 34dc97b9a0e ("blockjob: Wake up BDS when job becomes idle")

> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
>  job.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/job.c b/job.c
> index dbfa67bb0a..54db80df66 100644
> --- a/job.c
> +++ b/job.c
> @@ -352,6 +352,7 @@ void *job_create(const char *job_id, const JobDriver *driver, JobTxn *txn,
>      notifier_list_init(&job->on_finalize_completed);
>      notifier_list_init(&job->on_pending);
>      notifier_list_init(&job->on_ready);
> +    notifier_list_init(&job->on_idle);
>  
>      job_state_transition(job, JOB_STATUS_CREATED);
>      aio_timer_init(qemu_get_aio_context(), &job->sleep_timer,
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] job.c: add missing notifier initialization
  2021-11-03 16:21 [PATCH v1] job.c: add missing notifier initialization Emanuele Giuseppe Esposito
  2021-11-03 16:32 ` Philippe Mathieu-Daudé
@ 2021-11-04 10:04 ` Stefan Hajnoczi
  2021-11-12 18:04 ` Vladimir Sementsov-Ogievskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2021-11-04 10:04 UTC (permalink / raw)
  To: Emanuele Giuseppe Esposito
  Cc: Vladimir Sementsov-Ogievskiy, John Snow, qemu-devel, qemu-block

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

On Wed, Nov 03, 2021 at 12:21:55PM -0400, Emanuele Giuseppe Esposito wrote:
> It seems that on_idle list is not properly initialized like
> the other notifiers.
> 
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
>  job.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] job.c: add missing notifier initialization
  2021-11-03 16:21 [PATCH v1] job.c: add missing notifier initialization Emanuele Giuseppe Esposito
  2021-11-03 16:32 ` Philippe Mathieu-Daudé
  2021-11-04 10:04 ` Stefan Hajnoczi
@ 2021-11-12 18:04 ` Vladimir Sementsov-Ogievskiy
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-11-12 18:04 UTC (permalink / raw)
  To: Emanuele Giuseppe Esposito, qemu-block
  Cc: John Snow, qemu-devel, Stefan Hajnoczi

03.11.2021 19:21, Emanuele Giuseppe Esposito wrote:
> It seems that on_idle list is not properly initialized like
> the other notifiers.
> 
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
>   job.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/job.c b/job.c
> index dbfa67bb0a..54db80df66 100644
> --- a/job.c
> +++ b/job.c
> @@ -352,6 +352,7 @@ void *job_create(const char *job_id, const JobDriver *driver, JobTxn *txn,
>       notifier_list_init(&job->on_finalize_completed);
>       notifier_list_init(&job->on_pending);
>       notifier_list_init(&job->on_ready);
> +    notifier_list_init(&job->on_idle);
>   
>       job_state_transition(job, JOB_STATUS_CREATED);
>       aio_timer_init(qemu_get_aio_context(), &job->sleep_timer,
> 

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>


I don't think it worth applying it now:

job object is alloced with g_malloc0, so job->on_idle is initialized to zero.

notifier_list_init() simply calls QLIST_INIT(), which initializes the only field of QLIST structure to NULL. So, actually these notifier_list_init() calls are no-op in this context.

I queue it in jobs branch, but will not send a pull request until more critical fix comes for 6.2 or 6.3 development starts.

Thanks!

-- 
Best regards,
Vladimir


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-12 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 16:21 [PATCH v1] job.c: add missing notifier initialization Emanuele Giuseppe Esposito
2021-11-03 16:32 ` Philippe Mathieu-Daudé
2021-11-04 10:04 ` Stefan Hajnoczi
2021-11-12 18:04 ` Vladimir Sementsov-Ogievskiy

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.