From: Gollu Appalanaidu Date: Sat, 23 Jan 2021 09:01:35 +0000 (+0530) Subject: nvme: add fix for sanitize OWPASS value and log page structure X-Git-Tag: v1.14~116 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=102a3002f979a88d77ccbfb21baee54adaf30fb2;p=users%2Fsagi%2Fnvme-cli.git nvme: add fix for sanitize OWPASS value and log page structure OWPASS value will be from 0 to 15. Added the complete log data structure memebers, currently reseved fields are ignored currently. Signed-off-by: Gollu Appalanaidu --- diff --git a/linux/nvme.h b/linux/nvme.h index b3151797..6ba52579 100644 --- a/linux/nvme.h +++ b/linux/nvme.h @@ -1297,6 +1297,7 @@ struct nvme_sanitize_log_page { __le32 est_ovrwrt_time_with_no_deallocate; __le32 est_blk_erase_time_with_no_deallocate; __le32 est_crypto_erase_time_with_no_deallocate; + __u8 rsvd32[480]; }; /* diff --git a/nvme.c b/nvme.c index 42d2d0b1..5a11d70e 100644 --- a/nvme.c +++ b/nvme.c @@ -2820,8 +2820,8 @@ static int sanitize(int argc, char **argv, struct command *cmd, struct plugin *p } if (cfg.sanact == NVME_SANITIZE_ACT_OVERWRITE) { - if (cfg.owpass > 16) { - fprintf(stderr, "OWPASS out of range [0-16]\n"); + if (cfg.owpass >= 16) { + fprintf(stderr, "OWPASS out of range [0-15]\n"); ret = -EINVAL; goto close_fd; }