Skip to contentSkip to conversation

Patch "libnvdimm: clear the internal poison_list when clearing badblocks" has been added to the 4.8-stable tree

PATCH [email protected] 1 participant 1 message Oct 29, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

libnvdimm: clear the internal poison_list when clearing badblocks

to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
libnvdimm-clear-the-internal-poison_list-when-clearing-badblocks.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From e046114af5fcafe8d6d3f0b6ccb99804bad34bfb Mon Sep 17 00:00:00 2001

From: Vishal Verma <[email protected]>
Date: Fri, 30 Sep 2016 17:19:31 -0600
Subject: libnvdimm: clear the internal poison_list when clearing badblocks

From: Vishal Verma <[email protected]>

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")
---
 drivers/nvdimm/bus.c      |    2 +
 drivers/nvdimm/core.c     |   73 +++++++++++++++++++++++++++++++++++++++++++---
 include/linux/libnvdimm.h |    2 +
 3 files changed, 73 insertions(+), 4 deletions(-)
drivers/nvdimm/bus.c +2 -0
@@ -217,6 +217,8 @@ long nvdimm_clear_poison(struct device *
 		return rc;
 	if (cmd_rc < 0)
 		return cmd_rc;
+
+	nvdimm_clear_from_poison_list(nvdimm_bus, phys, len);
 	return clear_err.cleared;
 }
 EXPORT_SYMBOL_GPL(nvdimm_clear_poison);
drivers/nvdimm/core.c +69 -4

100 lines not on this page · raw message

include/linux/libnvdimm.h +2 -0
@@ -129,6 +129,8 @@ static inline struct nd_blk_region_desc
 }
 
 int nvdimm_bus_add_poison(struct nvdimm_bus *nvdimm_bus, u64 addr, u64 length);
+void nvdimm_clear_from_poison_list(struct nvdimm_bus *nvdimm_bus,
+		phys_addr_t start, unsigned int len);
 struct nvdimm_bus *nvdimm_bus_register(struct device *parent,
 		struct nvdimm_bus_descriptor *nfit_desc);
 void nvdimm_bus_unregister(struct nvdimm_bus *nvdimm_bus);

Patches currently in stable-queue which might be from [email protected] are

queue-4.8/libnvdimm-clear-the-internal-poison_list-when-clearing-badblocks.patch