Bug #13907
closeddiskinfo fails and exits on the first bad disk
100%
Description
On one of our systems diskinfo fails with the following message:
Assertion failed: err == 0, file diskinfo.c, line 275, function enumerate_disks
It seems this is happening because dm_get_attributes is returning NULL in enumerate disks, which we pass to get nvlist_lookup_uint64 on line 274 and get EINVAL back, triggering the assert on line 275.
Digging deeper it seems this a result of media_read_info in libdiskmgmt returning NULL due to the DKIOCGMEDIAINFO ioctl failing on a bad disk we have in our system.
Updated by Andrew Stormont almost 2 years ago
I have a fix out for review here: https://code.illumos.org/c/illumos-gate/+/1572
Testing: without the fix diskinfo would crash consistently on our system with a bad disk. With the fix applied diskinfo no longer crashes and we get output from diskinfo for all the other disks.
Updated by Andrew Stormont almost 2 years ago
To clarify: when we encountered this issue the assert was the only output we got from diskinfo. I suspect that in other configurations you might get a few lines of output first.
With the change above applied we now get a list of disks, excluding the bad disk. This applies to all output modes.
Updated by Electric Monk almost 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit ca706442e611a88ef5cbcd5deab686390a75263b
commit ca706442e611a88ef5cbcd5deab686390a75263b Author: Andrew Stormont <astormont@racktopsystems.com> Date: 2021-07-29T15:21:07.000Z 13907 diskinfo fails and exits on the first bad disk Reviewed by: Andy Fiddaman <andy@omnios.org> Reviewed by: Yuri Pankov <ypankov@tintri.com> Approved by: Robert Mustacchi <rm@fingolfin.org>