Skip to content

Commit

Permalink
tree: use logical block size for lba
Browse files Browse the repository at this point in the history
The kernel export the LBA size via the logical_block_size sysfs entry
not the physical_block_size.

Fixes: 7959f52 ("tree: read all attributes from sysfs when available")
Signed-off-by: Daniel Wagner <[email protected]>
  • Loading branch information
igaw committed Jan 19, 2024
1 parent 53e3a65 commit 5084885
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nvme/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit 5084885

Please sign in to comment.