[Devel] [PATCH hci-8.2 v2] dm-qcow2: use BLK_OPEN_* flags to test dm_table_get_mode()

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Sat Nov 21 11:40:02 MSK 2026


> dm_table_get_mode() returns blk_mode_t, but qcow2_attach_file(),
> qcow2_postsuspend() and qcow2_preresume() still test its result against
> FMODE_WRITE. The two flags have the same value today, so behaviour is
> unaffected. But it is the wrong type, and it is inconsistent with the
> rest of the driver, which already uses BLK_OPEN_WRITE.
> 
> Switch these checks to BLK_OPEN_WRITE. In qcow2_attach_file() test the
> read and write bits of the table mode against the file mode one by one
> instead of masking an fmode_t with a blk_mode_t.
> 
> The only reader of is_ro in qcow2_check_convert_hdr() is a
> commented-out check that refused a writable image whose dirty bit
> disagrees with the kernel_sets_dirty_bit parameter. Remove is_ro along
> with that check, and drop the ti argument, which is_ro was the only
> user of.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-152395
> Feature: dm-qcow2: block device over QCOW2 files driver
> 
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261121083700.4002573-1-alexander.ivanov@virtuozzo.com?part=1




More information about the Devel mailing list