Project

General

Profile

Bug #9985

blkdev devices can have an invalid devid

Added by Joshua M. Clulow over 2 years ago. Updated about 2 years ago.

Status:
New
Priority:
Normal
Category:
kernel
Start date:
2018-11-17
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

A hypervisor may expose Virtio emulated block devices to a guest. We have a driver for these devices, vioblk, which is based on the blkdev framework.

Unfortunately, the Virtio specification has (at least historically) not required the hypervisor to provide a unique serial number or identifier of any kind for each block device, and at least some common hypervisors elect not to do so. The way this is currently wired up, vioblk will, when there is no serial number, generate the same devid each time: id1,kdev@A~~~~~~~~~~~~~~~~~~~~. This confuses many other parts of the system (e.g., the disk management library) which expect a devid to uniquely identify the media behind a particular device.

Other disk devices (including ancient IDE disks, and the Xen emulated xdf device) will fabricate a devid if none is available naturally. This devid may be persisted to disk if the disk is correctly labelled with room for devid storage, which means the devid will persistently identify the media (even if the /devices path changes), as intended.

It would appear that we should put the same fabrication logic into blkdev, so that devices using that framework will correctly fabricate a devid if one does not naturally exist for the attached media.


Related issues

Related to illumos gate - Bug #10012: vioblk should not accept an all-zero serial numberClosedJoshua M. Clulow2018-11-28

Actions

Also available in: Atom PDF