]> git.ipfire.org Git - thirdparty/qemu.git/commit
block/mirror: Fix NULL s->job in active writes
authorHanna Reitz <hreitz@redhat.com>
Wed, 9 Nov 2022 16:54:50 +0000 (17:54 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 10 Nov 2022 12:33:55 +0000 (13:33 +0100)
commitda93d5c84e56e6b4e84aa8e98b6b984c9b6bb528
treed8b866ef3f8161885ebdd26e9c9426b8f3feb30c
parenteb994912993077f178ccb43b20e422ecf9ae4ac7
block/mirror: Fix NULL s->job in active writes

There is a small gap in mirror_start_job() before putting the mirror
filter node into the block graph (bdrv_append() call) and the actual job
being created.  Before the job is created, MirrorBDSOpaque.job is NULL.

It is possible that requests come in when bdrv_drained_end() is called,
and those requests would see MirrorBDSOpaque.job == NULL.  Have our
filter node handle that case gracefully.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20221109165452.67927-4-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/mirror.c