Commit 6915ad7c authored by Niklas Cassel's avatar Niklas Cassel Committed by Tomasz Zawadzki
Browse files

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: default avatarNiklas Cassel <niklas.cassel@wdc.com>
Change-Id: I6e542758c57efc376f921857c2cdb24e252d49c6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4837


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
parent 8a1d6f44
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
	}

	/*