block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()
commit722d8e73d65cb54f39d360ecb2147ac58f43c399
authorSergio Lopez <slp@redhat.com>
Mon, 1 Feb 2021 12:50:31 +0000 (1 13:50 +0100)
committerKevin Wolf <kwolf@redhat.com>
Tue, 2 Feb 2021 12:23:47 +0000 (2 13:23 +0100)
tree398b0df1336f93e5b9892307ee6aee916e9822ab
parentd7beddcc024f90da6375c1694b805fc282c79402
block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

Some graphs may contain an indirect reference to the first BDS in the
chain that can be reached while walking it bottom->up from one its
children.

Doubling-processing of a BDS is especially problematic for the
aio_notifiers, as they might attempt to work on both the old and the
new AIO contexts.

To avoid this problem, add every child and parent to the ignore list
before actually processing them.

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Sergio Lopez <slp@redhat.com>
Message-Id: <20210201125032.44713-2-slp@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c