OSDN Git Service

block: Fail gracefully when blockdev-snapshot creates loops
authorKevin Wolf <kwolf@redhat.com>
Mon, 18 Oct 2021 13:47:14 +0000 (15:47 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 2 Nov 2021 12:02:46 +0000 (13:02 +0100)
commitbfb8aa6d583b09378dcdb85d40c7951e44acd09f
tree9b6059ccd1c3a05b632e95590c1e39a66cb3eabc
parent13a028336f2c05e7ff47dfdaf30dfac7f4883e80
block: Fail gracefully when blockdev-snapshot creates loops

Using blockdev-snapshot to append a node as an overlay to itself, or to
any of its parents, causes crashes. Catch the condition and return an
error for these cases instead.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1824363
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211018134714.48438-1-kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
tests/qemu-iotests/085
tests/qemu-iotests/085.out