examples/nvme/hello_world: call exit() on read error
The printout in read_complete() says "Read I/O failed, aborting run", however, execution still continues, and prints and prints the buffer where the result was supposed to be stored. Since we got a read error, we will not have gotten any data stored in the buffer, so it is simply confusing to print it. Calling exit() in the read_complete() error handling code code also makes it consistent with the error handling code in write_complete() and reset_zone_complete(). Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Change-Id: I6e542758c57efc376f921857c2cdb24e252d49c6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4837 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
8a1d6f446d
commit
6915ad7c34
@ -102,6 +102,7 @@ read_complete(void *arg, const struct spdk_nvme_cpl *completion)
|
||||
fprintf(stderr, "I/O error status: %s\n", spdk_nvme_cpl_get_status_string(&completion->status));
|
||||
fprintf(stderr, "Read I/O failed, aborting run\n");
|
||||
sequence->is_completed = 2;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user