]> git.hungrycats.org Git - linux/commit
libnvdimm: clear the internal poison_list when clearing badblocks
authorVishal Verma <vishal.l.verma@intel.com>
Fri, 30 Sep 2016 23:19:31 +0000 (17:19 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2016 11:02:16 +0000 (05:02 -0600)
commit13c06fcc4a776dca0e23e15677d4884c9f4f40f9
treef0f07f4545bce4ce97232653b52efdd969a5d2b0
parent10a12e89de35ed6aa94b5b2002e887a9c867547d
libnvdimm: clear the internal poison_list when clearing badblocks

commit e046114af5fcafe8d6d3f0b6ccb99804bad34bfb upstream.

nvdimm_clear_poison cleared the user-visible badblocks, and sent
commands to the NVDIMM to clear the areas marked as 'poison', but it
neglected to clear the same areas from the internal poison_list which is
used to marshal ARS results before sorting them by namespace. As a
result, once on-demand ARS functionality was added:

37b137f nfit, libnvdimm: allow an ARS scrub to be triggered on demand

A scrub triggered from either sysfs or an MCE was found to be adding
stale entries that had been cleared from gendisk->badblocks, but were
still present in nvdimm_bus->poison_list. Additionally, the stale entries
could be triggered into producing stale disk->badblocks by simply disabling
and re-enabling the namespace or region.

This adds the missing step of clearing poison_list entries when clearing
poison, so that it is always in sync with badblocks.

Fixes: 37b137f ("nfit, libnvdimm: allow an ARS scrub to be triggered on demand")
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvdimm/bus.c
drivers/nvdimm/core.c
include/linux/libnvdimm.h