Hi,

I tried to add some support for using devices with PI/DIF metadata
and checked (through sysfs) how large metadata space per sector
is available.

The problem is that some values behave differently than I expected.

For an NVMe drive, reformatted to 4096 + 64 profile, I see this:

- /sys/block/<disk>/integrity/device_is_integrity_capable
  Contains 0 (?)
  According to docs, this field
 "Indicates whether a storage device is capable of storing integrity metadata.
 Set if the device is T10 PI-capable."

- /sys/block/<disk>/integrity/format
 Contains expected "nop" (not "none")

- /sys/block/<disk>/integrity/tag_size
  Contains 0 (?)
  According to docs, this is "Number of bytes of integrity tag space
  available per 512 bytes of data."
  (I think 512 bytes is incorrect; it should be sector size, or perhaps
   value in protection_interval_bytes, though.)

Then we have new (undocumented) value for NVMe in
- /sys/block/<nvme>/integrity/metadata_bytes
  This contains the correct 64.

Anyway, when I try to use it (for authentication tags in dm-crypt), it works.

Should tag_size and device_is_integrity_capable be set even for the "nop" 
format?
Is it a bug or a feature? :-)

If not, what is the correct way to read per-sector metadata size (not only for 
NVMe
as metadata_bytes is not available for other block devices)?

(This is on recent Linus' master - 6.14.0-rc4)

Thanks,
Milan

Reply via email to