[smartmontools-support] NVMe Critical Warning: What if multiple bits are set?

Claudio Kuenzler napsty at gmail.com
Mon Jun 10 11:53:26 CEST 2019


Hi Noel

Thanks for the technical explanation. One can tell I'm not a programmer ;-)

Following is the correct understanding of the function you referenced in
> the link:
>
>   * 0x01 = available spare has fallen below threshold
>   * 0x02 = temperature is above or below threshold
>   * 0x04 = NVM subsystem reliability has been degraded
>   * 0x08 = media has been placed in read only mode
>   * 0x10 = volatile memory backup device has failed
>   * any other bits set = unknown critical warning(s)
>
> I just changed the last line.
> The unsigned char w, which is a 1 byte (8 bit) value. It holds the set
> warnings, where each bit can be set or unset, depending on if a warning
> exists.
> E.g. if "available spare has fallen below threshold" and "temperature is
> above or below threshold" were set, w would have the value 0x3 (just 0x1
> and 0x2 ORed together).
>

That was my assumption, too (0x01 + 0x02 = 0x03). But, according to the
existing code, the function will not recognize 0x03 and will output
"unknown critical warning(s)", is this correct?

What about 0x08 + 0x10? That would give 0x18 but is this even possible?
Again, not a programmer so trying to understand the interpretation of the
bits here. According to
https://stackoverflow.com/questions/46416860/bit-manipulation-using-shifts-as-well-as-and
that would be:

3.) Represent 0x18 in binary

0x18 = 0001 1000
So that "looks" actually correct (only 4th and 5th bit are set).

Any good reference or "conversion table" on this topic would be
appreciated, I couldn't find one.

Again thanks Noel, your answer already helped me a lot!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://listi.jpberlin.de/pipermail/smartmontools-support/attachments/20190610/26ae6670/attachment.html>


More information about the Smartmontools-support mailing list