Project

General

Profile

Actions

Bug #13907

closed

diskinfo fails and exits on the first bad disk

Added by Andrew Stormont almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

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.

Actions #1

Updated by Electric Monk almost 2 years ago

  • Gerrit CR set to 1572
Actions #2

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.

Actions #3

Updated by Andrew Stormont almost 2 years ago

  • Description updated (diff)
Actions #4

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.

Actions #5

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>

Actions

Also available in: Atom PDF