Skip to content

Commit ede9a5f

Browse files
francispravin5igaw
authored andcommitted
nvme: use proper mask to get correct lbafu value
The NVME_NS_FLBAS_HIGHER/LOWER_MASK is used to get the format index value from Formatted LBA Size (FLBAS) field of Identify Namespace Data Structure. But, We are not getting the proper lbafu value while using the same macro on user passed format index value. So, use the proper mask to get the correct lbafu value. Signed-off-by: Francis Pravin <francis.p@samsung.com> Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
1 parent 4e12804 commit ede9a5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nvme.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -6264,8 +6264,8 @@ static int format_cmd(int argc, char **argv, struct command *cmd, struct plugin
62646264
struct nvme_format_nvm_args args = {
62656265
.args_size = sizeof(args),
62666266
.nsid = cfg.namespace_id,
6267-
.lbafu = (cfg.lbaf & NVME_NS_FLBAS_HIGHER_MASK) >> 4,
6268-
.lbaf = cfg.lbaf & NVME_NS_FLBAS_LOWER_MASK,
6267+
.lbafu = (cfg.lbaf >> 4) & 0x3,
6268+
.lbaf = cfg.lbaf & 0xf,
62696269
.mset = cfg.ms,
62706270
.pi = cfg.pi,
62716271
.pil = cfg.pil,

0 commit comments

Comments
 (0)