Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: > We are always using the given bs AioContext, so there is no need > to take the job ones (which is identical anyways). > This also reduces the point we need to check when protecting > job.aio_context field. > > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru> > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> > Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>
I'm not sure against which scenario this is actually protecting. The only reason for not using job.aio_context seems to be if someone else can change the job AioContext in parallel. However, if that is the case (I don't think it is, but for the hypothetical case this patch seems to address), the AioContext is not identical any more and the change is wrong because we actually want things to run in the job AioContext - otherwise accessing the BlockBackend from the job coroutine wouldn't be possible. So I believe the current code expresses how we actually want to use the BlockBackend and the change doesn't only protect nothing, but is even misleading because it implies that the job can work with any AioContext, which is not true. Kevin