]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
add 'return err' code to consider NVME I/O error situation in host (e.g., bash)
authorYongseok Oh <yongseok.oh@sk.com>
Tue, 6 Sep 2016 03:07:41 +0000 (12:07 +0900)
committerKeith Busch <keith.busch@intel.com>
Tue, 6 Sep 2016 22:18:07 +0000 (16:18 -0600)
nvme.c

diff --git a/nvme.c b/nvme.c
index 162509f5ef0b1d93bee7859e00ba58555a5fd3bc..79fd5fe3f29953eb7f041437145f75c40a0e96f8 100644 (file)
--- 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,