]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 15:50:18 +0000 (11:50 -0400)
commit322d6136a1c291a33cdcdc0ab55545410e93825f
tree55bbdd8b12a3ad32fc731dd6d05d94bb1d17d792
parent84647cf7bca50ad7e17185a97a319595427d41bf
libnvdimm, dimm: handle EACCES failures from label reads

BugLink: http://bugs.launchpad.net/bugs/1773233
commit e7c5a571a8d6a266aee9ca3f3f26e5afe3717eca upstream.

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: 4b27db7e26cd ("acpi, nfit: add support for the _LSI, _LSR, and...")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/nvdimm/dimm_devs.c