On Wed, 2016-01-06 at 14:31 -0800, Dan Williams wrote: > Support badblock checking in all the pmem read paths that do not go > through the block layer. This protects info block reads (btt or pfn) > as > well as data reads to a pmem namespace via a btt instance. > > Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx> > --- > drivers/nvdimm/btt.c | 11 +++++++++++ > drivers/nvdimm/btt_devs.c | 10 ++++++++++ > drivers/nvdimm/pfn_devs.c | 10 ++++++++++ > drivers/nvdimm/pmem.c | 9 +++++++-- > drivers/nvdimm/region_devs.c | 6 ++++++ > include/linux/nd.h | 2 ++ > 6 files changed, 46 insertions(+), 2 deletions(-) > > diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c > index efb2c1ceef98..0aca7d7edc05 100644 > --- a/drivers/nvdimm/btt.c > +++ b/drivers/nvdimm/btt.c > @@ -1388,6 +1388,7 @@ int nvdimm_namespace_attach_btt(struct > nd_namespace_common *ndns) > { > struct nd_btt *nd_btt = to_nd_btt(ndns->claim); > struct nd_region *nd_region; > + struct badblocks *bb; Should we explicitly include badblocks.h here? Same for the two usages that follow below.. > struct btt *btt; > size_t rawsize; > > @@ -1398,6 +1399,16 @@ int nvdimm_namespace_attach_btt(struct > nd_namespace_common *ndns) > if (rawsize < ARENA_MIN_SIZE) { > return -ENXIO; > } > + > + bb = nvdimm_namespace_badblocks(ndns, 0); > + if (IS_ERR(bb)) { > + if (PTR_ERR(bb) == -ENOENT) > + bb = NULL; > + else > + return PTR_ERR(bb); > + } > + > + ndns->bb = bb; > nd_region = to_nd_region(nd_btt->dev.parent); > btt = btt_init(nd_btt, rawsize, nd_btt->lbasize, nd_btt- > >uuid, > nd_region); -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html