From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
John Snow <jsnow@redhat.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PATCH 0/3] backup-top: Don't crash on post-finalize accesses
Date: Fri, 19 Feb 2021 16:33:45 +0100 [thread overview]
Message-ID: <20210219153348.41861-1-mreitz@redhat.com> (raw)
Hi,
After job-finalize, the backup-top node generally stays around. That’s
quite a problem, because its BlockCopyState is already freed then, and
it has no filtered child. We really want the node to be gone.
The only reference that realistically can keep it alive is that of the
backup job (though block_job_add_bdrv() called by block_job_create()).
Dropping that reference before bdrv_backup_top_drop() should[1] ensure
bdrv_backup_top_drop() will delete the node.
[1]: bdrv_backup_top_drop() replaces the backup-top node by its filtered
child, which detaches all parents from backup-top but the ones with
.stay_at_node set. The only parent that does this is a block job.
I don’t think nodes can be in use by multiple block jobs at once,
so the only parent with .stay_at_node set can be backup-top’s own
backup job.
Patch 2 is there kind of as a failsafe, and kind of because it just made
sense to me, even if it won’t do anything.
Max Reitz (3):
backup: Remove nodes from job in .clean()
backup-top: Refuse I/O in inactive state
iotests/283: Check that finalize drops backup-top
block/backup-top.c | 10 +++++++
block/backup.c | 1 +
tests/qemu-iotests/283 | 55 ++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/283.out | 15 +++++++++++
4 files changed, 81 insertions(+)
--
2.29.2
next reply other threads:[~2021-02-19 15:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-19 15:33 Max Reitz [this message]
2021-02-19 15:33 ` [PATCH 1/3] backup: Remove nodes from job in .clean() Max Reitz
2021-02-24 15:33 ` Kevin Wolf
2021-02-19 15:33 ` [PATCH 2/3] backup-top: Refuse I/O in inactive state Max Reitz
2021-02-19 15:33 ` [PATCH 3/3] iotests/283: Check that finalize drops backup-top Max Reitz
2021-02-19 15:59 ` Max Reitz
2021-02-24 15:50 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210219153348.41861-1-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).