[Devel] [PATCH hci-8.2] drivers/md/dm-qcow2: test the table mode against BLK_OPEN_WRITE, drop unused is_ro
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Nov 20 20:08:08 MSK 2026
I won't apply this version, please send v2 with the changes below.
- Rebase on hci-8.2: drop the qcow2_truncate_unused_tail() hunk, redo
the qcow2_postsuspend() hunk, take that function out of the list in
the message.
- Drop the ti argument of qcow2_check_convert_hdr(), is_ro was its
only user.
- Say in the message what the removed comment is.
- Use the "dm-qcow2:" prefix, the subject is 82 columns now.
The code is fine: every converted test checks the same bits as before.
On Fri, 20 Nov 2026 17:40:00 +0100, Alexander Ivanov wrote:
> dm_table_get_mode() returns blk_mode_t, but qcow2_check_convert_hdr(),
> qcow2_attach_file(), qcow2_truncate_unused_tail(), qcow2_postsuspend()
> and qcow2_preresume() still test its result against FMODE_WRITE.
fa6cf94f94fa6 ("dm-qcow2: truncate the unused tail of an image after
backward merge") is in hci-8.2 now. It took the mode test out of
qcow2_truncate_unused_tail() and calls it inside the FMODE_WRITE block
of qcow2_postsuspend(), so this patch does not apply there. Four sites
are left.
> The is_ro variable in qcow2_check_convert_hdr() has only a
> commented-out user. Remove it along with the dead code.
That is the dirty bit check disabled by 6e1526bb6ed59 ("dm-qcow2:
Temporary disable dirty bit check"), and kernel_sets_dirty_bit is
still a module parameter. Name the commit and say why the check is
not coming back, so nobody goes looking for it.
> - bool ext_l2, is_ro;
> + bool ext_l2;
With is_ro gone, nothing in qcow2_check_convert_hdr() uses ti, and
qcow2_parse_header() is its only caller. Drop the argument too.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list