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

Alexander Ivanov alexander.ivanov at virtuozzo.com
Tue Dec 1 11:07:16 MSK 2026


>> @@ -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.
Not a regression from this patch: get_dev_of_image() has been broken
since 2ab36beebc38 ("dm-qcow2: Extend status line - show qcow2 version
and cluster size") added the cluster size as the last table field.


More information about the Devel mailing list