]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
tree: use logical block size for lba
authorDaniel Wagner <dwagner@suse.de>
Fri, 19 Jan 2024 12:07:42 +0000 (13:07 +0100)
committerDaniel Wagner <wagi@monom.org>
Fri, 19 Jan 2024 12:11:18 +0000 (13:11 +0100)
The kernel export the LBA size via the logical_block_size sysfs entry
not the physical_block_size.

Fixes: 7959f52960fd ("tree: read all attributes from sysfs when available")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
src/nvme/tree.c

index 97bd3ef4e851483eb11cef2fb33d9ee45cb4d329..4d58845474cfa902ffec3655068bbcce83f12938 100644 (file)
@@ -2437,7 +2437,7 @@ static int nvme_ns_init(const char *path, struct nvme_ns *ns)
        struct sysfs_attr_table base[] = {
                { &ns->nsid,      nvme_strtou32,  true, "nsid" },
                { &ns->lba_count, nvme_strtou64,  true, "size" },
-               { &ns->lba_size,  nvme_strtou64,  true, "queue/physical_block_size" },
+               { &ns->lba_size,  nvme_strtou64,  true, "queue/logical_block_size" },
                { ns->eui64,      nvme_strtoeuid, false, "eui" },
                { ns->nguid,      nvme_strtouuid, false, "nguid" },
                { ns->uuid,       nvme_strtouuid, false, "uuid" }