[parted-devel] [PATCH 1/2] fdasd: geometry handling updated from upstream s390-tools

Viktor Mihajlovski mihajlov at linux.vnet.ibm.com
Wed Sep 16 16:06:48 UTC 2015


On 15.09.2015 20:01, Brian C. Lane wrote:
[...]
Thanks for reviewing the patch!
>> Remove the necessity for DASD-specific ioctls for partition handling.
>> This allows to correctly handle DASD-backed virtio block devices.
>
> I'm still not sure what the benefit of this is for the VM. Why not use
> the normal virtio devices?
I'll enhance the log message with an explanation. In a nutshell it's
to support passing ECKD DASDs via virtio, which is perfectly valid on
DASD-only systems
As virtio is just a transport the intrinsic geometry specifics of
DASDs are retained even if the transport-specific ioctls are not
available. This is why upstreams s390-tools fdasd has a fallback
that I'm backporting here.
>
>> +/* kl: key length, dl: data length */
>> +static unsigned int recs_per_track(unsigned short dev_type, unsigned int kl,
>> +				   unsigned int dl)
>> +{
>> +	int dn, kn;
>
> These should be unsigned int since that's what ceil_quot returns.
>
>>   	} else {
>> +	        if (ioctl(f, BLKGETSIZE64, &size_in_bytes) != 0) {
>> +		        fdasd_error(anc, unable_to_ioctl,
>> +				    "Could not retrieve disk size.");
>> +		}
>
> This should be a translated string. Also, does it need more error
> handling? I see that most of the fdasd_error calls currently fall
> through without doing anything special and I'm not sure how correct that
> is.
>
>> +		if (ioctl(f, BIODASDINFO, &dasd_info) != 0) {
>> +		        /* verify that the geometry matches a 3390 DASD */
>> +		        if (!fdasd_verify_geometry(DASD_3390_TYPE, blksize,
>> +						   &anc->geo)) {
>> +			        fdasd_error(anc, wrong_disk_type,
>> +					    "Disk geometry does not match a "
>> +					    "DASD device of type 3390.");
>> +				goto error;
>
> This should also be a translated string.
>
Sorry about those. The backport was (too) verbatim. Will fix that in
a V2.

-- 

Mit freundlichen Grüßen/Kind Regards
    Viktor Mihajlovski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Köderitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294




More information about the parted-devel mailing list