Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fabrics: update return values for dim #2575

Merged
merged 1 commit into from
Nov 22, 2024
Merged
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
13 changes: 7 additions & 6 deletions fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ int nvmf_config(const char *desc, int argc, char **argv)
return 0;
}

static void dim_operation(nvme_ctrl_t c, enum nvmf_dim_tas tas, const char *name)
static int dim_operation(nvme_ctrl_t c, enum nvmf_dim_tas tas, const char *name)
{
static const char * const task[] = {
[NVMF_DIM_TAS_REGISTER] = "register",
Expand All @@ -1451,6 +1451,8 @@ static void dim_operation(nvme_ctrl_t c, enum nvmf_dim_tas tas, const char *name
fprintf(stderr, "%s DIM %s command error. Result:0x%04x, Status:0x%04x - %s\n",
name, t, result, status, nvme_status_to_string(status, false));
}

return nvme_status_to_errno(status, true);
}

int nvmf_dim(const char *desc, int argc, char **argv)
Expand Down Expand Up @@ -1530,9 +1532,8 @@ int nvmf_dim(const char *desc, int argc, char **argv)
nvme_for_each_subsystem(h, s) {
if (strcmp(nvme_subsystem_get_nqn(s), p))
continue;
nvme_subsystem_for_each_ctrl(s, c) {
dim_operation(c, tas, p);
}
nvme_subsystem_for_each_ctrl(s, c)
ret = dim_operation(c, tas, p);
}
}
}
Expand All @@ -1551,9 +1552,9 @@ int nvmf_dim(const char *desc, int argc, char **argv)
p, nvme_strerror(errno));
return -errno;
}
dim_operation(c, tas, p);
ret = dim_operation(c, tas, p);
}
}

return 0;
return ret;
}