From: Yongseok Oh Date: Tue, 6 Sep 2016 03:07:41 +0000 (+0900) Subject: add 'return err' code to consider NVME I/O error situation in host (e.g., bash) X-Git-Tag: v1.0~65 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4c97b20b4708b739c314baab7b0cdd0e85fa1d76;p=users%2Fsagi%2Fnvme-cli.git add 'return err' code to consider NVME I/O error situation in host (e.g., bash) --- diff --git a/nvme.c b/nvme.c index 162509f5..79fd5fe3 100644 --- a/nvme.c +++ b/nvme.c @@ -1850,7 +1850,7 @@ static int dsm(int argc, char **argv, struct command *cmd, struct plugin *plugin nvme_status_to_string(err), err); else printf("NVMe DSM: success\n"); - return 0; + return err; } static int flush(int argc, char **argv, struct command *cmd, struct plugin *plugin) @@ -1886,7 +1886,7 @@ static int flush(int argc, char **argv, struct command *cmd, struct plugin *plug nvme_status_to_string(err), err); else printf("NVMe Flush: success\n"); - return 0; + return err; } static int resv_acquire(int argc, char **argv, struct command *cmd, struct plugin *plugin) @@ -1949,7 +1949,7 @@ static int resv_acquire(int argc, char **argv, struct command *cmd, struct plugi fprintf(stderr, "NVME IO command error:%04x\n", err); else printf("NVME Reservation Acquire success\n"); - return 0; + return err; } static int resv_register(int argc, char **argv, struct command *cmd, struct plugin *plugin) @@ -2009,7 +2009,7 @@ static int resv_register(int argc, char **argv, struct command *cmd, struct plug fprintf(stderr, "NVME IO command error:%04x\n", err); else printf("NVME Reservation success\n"); - return 0; + return err; } static int resv_release(int argc, char **argv, struct command *cmd, struct plugin *plugin) @@ -2075,7 +2075,7 @@ static int resv_release(int argc, char **argv, struct command *cmd, struct plugi fprintf(stderr, "NVME IO command error:%04x\n", err); else printf("NVME Reservation Release success\n"); - return 0; + return err; } static int resv_report(int argc, char **argv, struct command *cmd, struct plugin *plugin) @@ -2146,7 +2146,7 @@ static int resv_report(int argc, char **argv, struct command *cmd, struct plugin show_nvme_resv_report(status); } } - return 0; + return err; } static int submit_io(int opcode, char *command, const char *desc,