On 2/25/2025 2:53 PM, Milan Broz wrote: > 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 (?) This and "nop" indicates that pi-type was configured to be 0? Maybe you can share the nvme format command as well. > 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. Maybe you mean "/sys/block/>/metadata_bytes"?