Presently the error code returned via out variable 'cmd_rc' from the
nvdimm-bus controller function is ignored when called from
__nd_ioctl() and never communicated back to user-space code that called
an ioctl on dimm/bus.
This minor patch updates __nd_ioctl() to propagate the value of out
variable 'cmd_rc' back to user-space in case it reports an error.
Signed-off-by: Vaibhav Jain <redacted>
---
drivers/nvdimm/bus.c | 5 +++++
1 file changed, 5 insertions(+)
From: Jeff Moyer <hidden> Date: 2020-02-18 21:02:52
Vaibhav Jain [off-list ref] writes:
quoted hunk
Presently the error code returned via out variable 'cmd_rc' from the
nvdimm-bus controller function is ignored when called from
__nd_ioctl() and never communicated back to user-space code that called
an ioctl on dimm/bus.
This minor patch updates __nd_ioctl() to propagate the value of out
variable 'cmd_rc' back to user-space in case it reports an error.
Signed-off-by: Vaibhav Jain <redacted>
---
drivers/nvdimm/bus.c | 5 +++++
1 file changed, 5 insertions(+)
From: Dan Williams <hidden> Date: 2020-02-18 21:13:24
On Tue, Feb 18, 2020 at 1:00 PM Jeff Moyer [off-list ref] wrote:
Vaibhav Jain [off-list ref] writes:
quoted
Presently the error code returned via out variable 'cmd_rc' from the
nvdimm-bus controller function is ignored when called from
__nd_ioctl() and never communicated back to user-space code that called
an ioctl on dimm/bus.
This minor patch updates __nd_ioctl() to propagate the value of out
variable 'cmd_rc' back to user-space in case it reports an error.
Signed-off-by: Vaibhav Jain <redacted>
---
drivers/nvdimm/bus.c | 5 +++++
1 file changed, 5 insertions(+)
From: Dan Williams <hidden> Date: 2020-02-29 02:39:13
On Tue, Feb 18, 2020 at 1:03 PM Dan Williams [off-list ref] wrote:
On Tue, Feb 18, 2020 at 1:00 PM Jeff Moyer [off-list ref] wrote:
quoted
Vaibhav Jain [off-list ref] writes:
quoted
Presently the error code returned via out variable 'cmd_rc' from the
nvdimm-bus controller function is ignored when called from
__nd_ioctl() and never communicated back to user-space code that called
an ioctl on dimm/bus.
This minor patch updates __nd_ioctl() to propagate the value of out
variable 'cmd_rc' back to user-space in case it reports an error.
Signed-off-by: Vaibhav Jain <redacted>
---
drivers/nvdimm/bus.c | 5 +++++
1 file changed, 5 insertions(+)
Looks good to me.
Reviewed-by: Jeff Moyer <redacted>
Applied.
Unapplied. This breaks the NVDIMM unit test, and now that I look
closer you are likely overlooking the fact that cmd_rc is a
translation of the firmware status, while the ioctl rc is whether the
command was successfully submitted. If you want the equivalent of
cmd_rc in userspace you need to translate the firmware status. See
ndctl_cmd_submit_xlat() in libndctl as an example of how the
equivalent of cmd_rc is generated from the firmware status.