Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ int nvme_submit_passthru(int fd, unsigned long ioctl_cmd,
if (!nvme_cfg.dry_run) {
retry:
err = ioctl(fd, ioctl_cmd, cmd);
if (err && (errno == EAGAIN ||
(errno == EINTR && !nvme_sigint_received))) {
if ((err && (errno == EAGAIN ||
(errno == EINTR && !nvme_sigint_received))) &&
!nvme_cfg.no_retries) {
nvme_log_retry(errno);
goto retry;
}
Expand Down Expand Up @@ -153,8 +154,9 @@ int nvme_submit_passthru64(int fd, unsigned long ioctl_cmd,
if (!nvme_cfg.dry_run) {
retry:
err = ioctl(fd, ioctl_cmd, cmd);
if (err && (errno == EAGAIN ||
(errno == EINTR && !nvme_sigint_received))) {
if ((err && (errno == EAGAIN ||
(errno == EINTR && !nvme_sigint_received))) &&
!nvme_cfg.no_retries) {
nvme_log_retry(errno);
goto retry;
}
Expand Down
3 changes: 3 additions & 0 deletions nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct nvme_config {
int verbose;
__u32 timeout;
bool dry_run;
bool no_retries;
unsigned int output_format_ver;
};

Expand All @@ -93,6 +94,8 @@ struct nvme_config {
##__VA_ARGS__, \
OPT_UINT("timeout", 't', &nvme_cfg.timeout, timeout), \
OPT_FLAG("dry-run", 0, &nvme_cfg.dry_run, dry_run), \
OPT_FLAG("no-retries", 0, &nvme_cfg.no_retries, \
"disable retry logic on errors\n"), \
OPT_UINT("output-format-version", 0, &nvme_cfg.output_format_ver, \
"output format version: 1|2"), \
OPT_END() \
Expand Down