]> git.baikalelectronics.ru Git - kernel.git/commit
libnvdimm, dimm: handle EACCES failures from label reads
authorDan Williams <dan.j.williams@intel.com>
Mon, 9 Apr 2018 19:34:24 +0000 (12:34 -0700)
committerDan Williams <dan.j.williams@intel.com>
Mon, 16 Apr 2018 15:18:51 +0000 (08:18 -0700)
commit968990489d94144c9374058e0f2b04b996480219
treeb3f9dbb9f9f7cc95d05384f0dd0bcea01130796e
parentfedbd783dfdfa040524ea8eb8a31cb2a775a133b
libnvdimm, dimm: handle EACCES failures from label reads

The new support for the standard _LSR and _LSW methods neglected to also
update the nvdimm_init_config_data() and nvdimm_set_config_data() to
return the translated error code from failed commands. This precision is
necessary because the locked status that was previously returned on
ND_CMD_GET_CONFIG_SIZE commands is now returned on
ND_CMD_{GET,SET}_CONFIG_DATA commands.

If the kernel misses this indication it can inadvertently fall back to
label-less mode when it should otherwise avoid all access to locked
regions.

Cc: <stable@vger.kernel.org>
Fixes: b8d5b14404a8 ("acpi, nfit: add support for the _LSI, _LSR, and...")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/dimm_devs.c