nvme-format: protection information enabled although metadata size is 0

Binarus lists at binarus.de
Mon Oct 31 02:27:34 PDT 2022


Dear all,

after having read the subjects of the posts in October, I am afraid that 
a dumb newbie question like the following may be inappropriate here. But 
due to the lack of other options (tried other Q & A sites without 
success), I'll be brave ... Having said this:

On a machine with Debian Bullseye and nvme-cli 1.12, I have formatted an 
Intel DC P3700 the following way:

   nvme format /dev/nvme0 -l 3 -i 1 -f

That command has been executed within a few seconds without any error. 
But in my understanding, it should have failed. '-l 3' means 4096 bytes 
LBA without metadata, but '-i 1' enables T10 protection information 
which needs 8 bytes of metadata.

Afterwards, I have checked the output of

   nvme id-ns /dev/nvme0n1 -H

It is quite long, so I am shortening it; the relevant lines are

   dps     : 0x1
     [3:3] : 0     Protection Information is Transferred as Last 8 Bytes 
of Metadata
     [2:0] : 0x1   Protection Information Type 1 Enabled
   ...
   LBA Format  3 : Metadata Size: 0   bytes - Data Size: 4096 bytes - 
Relative Performance: 0 Best (in use)

As expected, and according to the format command, a metadata size of 0 
is in use, but the protection information is enabled.

Could somebody please explain that in simple words? How can the PI be 
enabled although there is no room for the checksums, and how does the 
device actually behave now?

Best regards, and thank you very much in advance,

Binarus

P.S. From the revision 2c of the NVMe base specification, page 172, I 
also got the impression that the format command shown above should have 
failed. In figure 190, in the first table row, there is:

Invalid Format: The format specified is invalid. This may be due to 
various conditions, including:
1. specifying an invalid User Data Format number;
2. enabling protection information when there are not sufficient 
metadata resources; or
3. the specified format is not available in the current configuration.

Item 2 reflects the situation described above, doesn't it? But then the 
format command should return an error, and actually should not format 
the device, correct?



More information about the Linux-nvme mailing list