nvmet: don't report 0-bytes in serial number
authorMartin Wilck <mwilck@suse.com>
Thu, 13 Jul 2017 22:25:31 +0000 (00:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 16 Jun 2018 07:52:32 +0000 (09:52 +0200)
commitf43d8e4c8619c5ac15697ca63747737000441aca
tree8c3e350b40e662740abdea9383d60ff0b57cfe18
parent1e38f8e9864f2c52775743694f0517c6bd276d83
nvmet: don't report 0-bytes in serial number

commit 42de82a8b544fa55670feef7d6f85085fba48fc0 upstream.

The NVME standard mandates that the SN, MN, and FR fields of the Identify
Controller Data Structure be "ASCII strings".  That means that they may
not contain 0-bytes, not even string terminators.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
[hch: fixed for the move of the serial field, updated description]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/target/admin-cmd.c