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

Noel Kuntze noel.kuntze at thermi.consulting
Mon Jun 10 12:47:39 CEST 2019


Hello Claudio,

> 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
>

0x3 (hexadecimal) is 11 in binary. That's just 0x1 and 0x2 ORed together. The code checks each bit.

Kind regards
Noel

Am 10.06.19 um 11:53 schrieb Claudio Kuenzler:
> 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!
>
> _______________________________________________
> Smartmontools-support mailing list
> Smartmontools-support at listi.jpberlin.de
> https://listi.jpberlin.de/mailman/listinfo/smartmontools-support

-- 
Noel Kuntze
IT security consultant

GPG Key ID: 0x0739AD6C
Fingerprint: 3524 93BE B5F7 8E63 1372 AF2D F54E E40B 0739 AD6C


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://listi.jpberlin.de/pipermail/smartmontools-support/attachments/20190610/7b763ced/attachment.asc>


More information about the Smartmontools-support mailing list