From: Jeffrey Lien Date: Wed, 6 Mar 2019 17:01:49 +0000 (+0000) Subject: WDC plugin Change vs-internal-log Command to Save Partial E6 Log Data. X-Git-Tag: v1.8~18 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2be53eae79b1c625de24d94add02e206e8cc006c;p=users%2Fsagi%2Fnvme-cli.git WDC plugin Change vs-internal-log Command to Save Partial E6 Log Data. Signed-off-by: Jeff Lien --- diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c index 6a2dac84..f78325a9 100644 --- a/plugins/wdc/wdc-nvme.c +++ b/plugins/wdc/wdc-nvme.c @@ -1185,8 +1185,14 @@ static int wdc_do_dump_e6(int fd, __u32 opcode,__u32 data_len, if (ret == 0) { fprintf(stderr, "%s: NVMe Status:%s(%x)\n", __func__, nvme_status_to_string(ret), ret); - ret = wdc_create_log_file(file, dump_data, data_len); + } else { + fprintf(stderr, "%s: FAILURE: NVMe Status:%s(%x)\n", __func__, nvme_status_to_string(ret), ret); + fprintf(stderr, "%s: Partial data may have been captured\n", __func__); + snprintf(file + strlen(file), PATH_MAX, "%s", "-PARTIAL"); } + + ret = wdc_create_log_file(file, dump_data, data_len); + free(dump_data); return ret; }