]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme: Bug fix default data_len used if no argument given
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Tue, 3 Aug 2021 04:47:13 +0000 (13:47 +0900)
committerKeith Busch <kbusch@kernel.org>
Tue, 3 Aug 2021 14:47:16 +0000 (08:47 -0600)
current logic ignore given data by user
so make priority to use user argument first

this change make available vendor specific command on set-feature, get-feature with data_len

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
nvme.c

diff --git a/nvme.c b/nvme.c
index c3ab5fef87cd03afbbe0c27f1473a65591378bab..ebe81355b9d0f0377ae566402c2f8a317aa5efbe 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -2839,7 +2839,8 @@ static int get_feature(int argc, char **argv, struct command *cmd, struct plugin
                goto close_fd;
        }
 
-       cfg.data_len = nvme_feat_buf_len[cfg.feature_id];
+       if (!cfg.data_len)
+               cfg.data_len = nvme_feat_buf_len[cfg.feature_id];
 
        /* check for Extended Host Identifier */
        if (cfg.feature_id == NVME_FEAT_HOST_ID && (cfg.cdw11 & 0x1))