linux-nvme / nvme-cli

NVMe management command line interface.

Home Page:https://nvmexpress.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update get_log message for non-dw aligned error

Neney13rx opened this issue · comments

The get_log command is enforcing DWORD alignment in the data length but the error message says "non-dw aligned required" which is confusing.

nvme-cli/nvme.c

Line 2250 in 7799dfd

nvme_show_error("non-zero or non-dw alignment log-len is required param");

nvme_get_log function in libnvme will round down the length. Let's say an user ask for 17 bytes, only get 16 bytes will requested. We cut it short. I think this is the reason why we have this check there and an proper error message.

Don't know if it would be clever to round up and request more and then trim the result on our end. That might not work.

My take is that it makes sense to enforce valid command line arguments.