]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: add fix for sanitize OWPASS value and log page structure
authorGollu Appalanaidu <anaidu.gollu@samsung.com>
Sat, 23 Jan 2021 09:01:35 +0000 (14:31 +0530)
committerKeith Busch <kbusch@kernel.org>
Tue, 26 Jan 2021 21:22:33 +0000 (14:22 -0700)
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 <anaidu.gollu@samsung.com>
linux/nvme.h
nvme.c

index b3151797198fa8e9a4a434529ba8e57a9ddd5d0c..6ba5257950231cca331b04fe82e78ae6eab431ac 100644 (file)
@@ -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 42d2d0b12946aae7c6d7ebb56176278a47692403..5a11d70e117c3ea924f8755a4750f74e691c178a 100644 (file)
--- 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;
                }