[Devel] [PATCH hci-8.2 v2 6/7] dm-qcow2: add the report_enospc table argument

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Dec 1 04:14:19 MSK 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dm-qcow2: new status flags word breaks qcow2-dm.sh image count
  parsing
--

commit 3afae0c25611528e9beb7adeef464dfc7ec8b401
Author: Alexander Ivanov <alexander.ivanov at virtuozzo.com>

dm-qcow2: add the report_enospc table argument

This adds an optional first table argument, report_enospc. When it is set, a request that fails with ENOSPC is completed with BLK_STS_NOSPC at once instead of being delayed. The table status line gets a flags field, and the target version goes to 1.1.0.

> diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c
> --- a/drivers/md/dm-qcow2-target.c
> +++ b/drivers/md/dm-qcow2-target.c

[ ... ]

> @@ -1152,8 +1164,15 @@ static void qcow2_status(struct dm_target *ti, status_type_t type,
>  		result[0] = '\0';
>  		break;
>  	case STATUSTYPE_TABLE:
> -		DMEMIT("%u v%u %llu", qcow2->img_id + 1, hdr->version,
> -				      to_sector(qcow2->clu_size));
> +		if (READ_ONCE(tgt->event_enospc))
> +			*p++ = 's';
> +		if (tgt->report_enospc)
> +			*p++ = 'r';
> +		if (p == stat)
> +			*p++ = 'o';
> +		*p = '\0';
> +		DMEMIT("%u v%u %llu %s", qcow2->img_id + 1, hdr->version,
> +					 to_sector(qcow2->clu_size), stat);
>  		break;

[Severity: Low]
Does appending the flags word to every table line break scripts/qcow2-dm.sh?

get_dev_of_image() there takes the last character of the dmsetup table line as the image count:

scripts/qcow2-dm.sh:get_dev_of_image() {
	nr_imgs=`echo $line | sed "s/.*\(\w\)$/\1/"`

That last character is now always a flag letter (o, r or s). top_img_id=$((nr_imgs - 1)) then evaluates the letter as an unset variable and gives -1, so the lookup fails with "Error during search of device". The remove, check, snapshot and resize commands that use this lookup stop working. The script isn't updated in this patch, and the commit message doesn't say that existing consumers of the table line need changing.

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/20261130162456.1822406-1-alexander.ivanov@virtuozzo.com?part=6



More information about the Devel mailing list