Makes sense.te_unit_[min| max]_sectors expects sectors (512 bytes unit)Yeah, you are right. I think that we can just use:
as input but no conversion is done here from device logical block size
to SECTORs.
blk_queue_atomic_write_unit_max_sectors(disk->queue,
atomic_bs >> SECTOR_SHIFT);
I still don't grok the difference between max_bytes and unit_max_sectors here.
(Maybe NVMe spec does not differentiate it?)
I assume min_sectors should be as follows instead of setting it to 1 (512 bytes)?
blk_queue_atomic_write_unit_min_sectors(disk->queue, bs >> SECTORS_SHIFT);