]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: fix space padding in serial number
authorDaniel Verkamp <daniel.verkamp@intel.com>
Thu, 12 Apr 2018 15:16:13 +0000 (09:16 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Apr 2018 15:58:27 +0000 (09:58 -0600)
commit5ea004e60f4c9f2537cad23d295732ee12b84a6f
treeec639511266b10b966d413891998586c7d539ef3
parent8376a726303e49f5e379c5d860a71bf6ddd1d6a4
nvmet: fix space padding in serial number

Commit a55b0f9e9ae9 previously attempted to fix this, and it did
correctly pad the MN and FR fields with spaces, but the SN field still
contains 0 bytes.  The current code fills out the first 16 bytes with
hex2bin, leaving the last 4 bytes zeroed.  Rather than adding a lot of
error-prone math to avoid overwriting SN twice, just set the whole thing
to spaces up front (it's only 20 bytes).

Fixes: a55b0f9e9ae9 ("nvmet: don't report 0-bytes in serial number")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/admin-cmd.c