|
Description
|
Category
kernel
Sub-Category
zfs
Description
vdev_disk.c, function vdev_disk_open_common() calls ddi_pathname_to_dev_t()
and tests the returned value against ENODEV:
/*
* If all else fails, then try opening by physical path (if available)
* or the logical path (if we failed due to the devid check). While not
* as reliable as the devid, this will give us something, and the higher
* level vdev validation will prevent us from opening the wrong device.
*/
if (error) {
if (vd->vdev_physpath != NULL &&
(dev = ddi_pathname_to_dev_t(vd->vdev_physpath)) != ENODEV)
error = ldi_open_by_dev(&dev, OTYP_BLK, spa_mode,
kcred, &dvd->vd_lh, zfs_li);
ENODEV (errno code) isn't a special return value from ddi_pathname_to_dev_t()
on failures; the comment in usr/src/uts/common/os/devcfg.c states that
NODEV is returned on failure:
/*
* Given the pathname of a device, return the dev_t of the corresponding
* device. Returns NODEV on failure.
*
* Note that this call sets the DDI_NO_AUTODETACH property on the devinfo node.
*/
dev_t ddi_pathname_to_dev_t(char *pathname);
Correct test for failures in vdev_disk.c should be
(dev = ddi_pathname_to_dev_t(vd->vdev_physpath)) != NODEV
Frequency
Always
Regression
No
Steps to Reproduce
Look at the usr/src/uts/common/fs/zfs/vdev_disk.c
function vdev_disk_open_common()
Expected Result
ddi_pathname_to_dev_t() return value is tested against NODEV
Actual Result
return value is tested against ENODEV; ldi_open_by_dev() is called with
invalid dev_t values.
Error Message(s)
Test Case
Workaround
Submitter wants to work on bug
No
Additional configuration information
|