Re: [PATCH 1/1] qcow2: do not try to clear the dirty bit on a read-only node

Michael Tokarev <[email protected]> Tue, 4 Aug 2026 11:22:12 +0300
Newsgroups gmane.comp.emulators.qemu.block,gmane.comp.emulators.qemu,gmane.comp.emulators.qemu.stable
Message-ID <[email protected]>
On 7/16/26 18:35, Denis V. Lunev wrote:
> qcow2_do_close() -> qcow2_inactivate() clears the dirty bit with a
> plain write to bs->file, unconditionally. A read-only node can still
> be dirty, inherited from an earlier writable session, and that write
> then hits a missing BLK_PERM_WRITE and asserts in
> bdrv_co_write_req_prepare() (block/io.c) on an entirely ordinary
> close -- closing is expected, the dirty bit on a read-only node
> is not.
> 
> Skip the clear for read-only nodes, same as read access already does.
> Any other still-dirty node keeps the unguarded write: it is expected
> to hold write permission, and a missing one there is a bug worth
> seeing.

This seems to be another qmeu-stable material.
Please don't forget to Cc: qemu-stable@ on applicable changes.

Thanks,

/mjt