Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1735200 > unrolled thread
| Started by | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| First post | 2017-09-19 22:00 +0200 |
| Last post | 2017-09-20 00:20 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 1/2] tools/testing/nvdimm: disable labels for nfit_test.1 Dan Williams <dan.j.williams@intel.com> - 2017-09-19 22:00 +0200
[PATCH 2/2] libnvdimm, namespace: fix btt claim class crash Dan Williams <dan.j.williams@intel.com> - 2017-09-19 22:00 +0200
Re: [PATCH 2/2] libnvdimm, namespace: fix btt claim class crash "Saldivar, Maurice A." <maurice.a.saldivar@hpe.com> - 2017-09-20 00:10 +0200
Re: [PATCH 2/2] libnvdimm, namespace: fix btt claim class crash Dan Williams <dan.j.williams@intel.com> - 2017-09-20 00:20 +0200
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2017-09-19 22:00 +0200 |
| Subject | [PATCH 1/2] tools/testing/nvdimm: disable labels for nfit_test.1 |
| Message-ID | <urwQy-1e6-13@gated-at.bofh.it> |
Improve coverage of NVDIMM-N test scenarios by providing a test bus incapable of label operations. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- tools/testing/nvdimm/test/nfit.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index d20791c3f499..bef419d4266d 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c @@ -1527,9 +1527,6 @@ static void nfit_test1_setup(struct nfit_test *t) set_bit(ND_CMD_ARS_START, &acpi_desc->bus_cmd_force_en); set_bit(ND_CMD_ARS_STATUS, &acpi_desc->bus_cmd_force_en); set_bit(ND_CMD_CLEAR_ERROR, &acpi_desc->bus_cmd_force_en); - set_bit(ND_CMD_GET_CONFIG_SIZE, &acpi_desc->dimm_cmd_force_en); - set_bit(ND_CMD_GET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en); - set_bit(ND_CMD_SET_CONFIG_DATA, &acpi_desc->dimm_cmd_force_en); } static int nfit_test_blk_do_io(struct nd_blk_region *ndbr, resource_size_t dpa,
[toc] | [next] | [standalone]
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2017-09-19 22:00 +0200 |
| Subject | [PATCH 2/2] libnvdimm, namespace: fix btt claim class crash |
| Message-ID | <urwQz-1e6-37@gated-at.bofh.it> |
| In reply to | #1735200 |
Maurice reports:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
IP: holder_class_store+0x253/0x2b0 [libnvdimm]
...while trying to reconfigure an NVDIMM-N namespace into 'sector' /
'btt' mode. The crash points to this line:
(gdb) li *(holder_class_store+0x253)
0x7773 is in holder_class_store (drivers/nvdimm/namespace_devs.c:1420).
1415 for (i = 0; i < nd_region->ndr_mappings; i++) {
1416 struct nd_mapping *nd_mapping = &nd_region->mapping[i];
1417 struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
1418 struct nd_namespace_index *nsindex;
1419
1420 nsindex = to_namespace_index(ndd, ndd->ns_current);
...where we are failing because ndd is NULL due to NVDIMM-N dimms not
supporting labels.
Long story short, default to the BTTv1 format in the label-less /
NVDIMM-N case.
Fixes: 14e494542636 ("libnvdimm, btt: BTT updates for UEFI 2.7 format")
Cc: <stable@vger.kernel.org>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Reported-by: Maurice A. Saldivar <maurice.a.saldivar@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/nvdimm/namespace_devs.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 1427a386a033..3e4d1e7998da 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1417,6 +1417,15 @@ static int btt_claim_class(struct device *dev)
struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
struct nd_namespace_index *nsindex;
+ /*
+ * If any of the DIMMs do not support labels the only
+ * possible BTT format is v1.
+ */
+ if (!ndd) {
+ loop_bitmask = 0;
+ break;
+ }
+
nsindex = to_namespace_index(ndd, ndd->ns_current);
if (nsindex == NULL)
loop_bitmask |= 1;
[toc] | [prev] | [next] | [standalone]
| From | "Saldivar, Maurice A." <maurice.a.saldivar@hpe.com> |
|---|---|
| Date | 2017-09-20 00:10 +0200 |
| Subject | Re: [PATCH 2/2] libnvdimm, namespace: fix btt claim class crash |
| Message-ID | <urySl-2Ga-1@gated-at.bofh.it> |
| In reply to | #1735211 |
I applied this and the kernel patch and was successfully able to
configure an NVDIMM-N into sector mode. I do have a question about
specific behavior I observed. Before I was able to configure an NVDIMM
into any mode from any mode. With these patchs if I go to sector mode
and try going to memory or dax mode it fails with:
# ndctl create-namespace -f -e namespace0.0 -m memory
Error: namespace0.0: sector_size: 4096 not supported
failed to reconfigure namespace: Invalid argument
but if I go sector->raw-><mode> I can get into other modes fine. Was
this the intended behavior?
Sincerely,
Maurice
On Tue, 2017-09-19 at 12:51 -0700, Dan Williams wrote:
> Maurice reports:
>
> BUG: unable to handle kernel NULL pointer dereference at
> 0000000000000028
> IP: holder_class_store+0x253/0x2b0 [libnvdimm]
>
> ...while trying to reconfigure an NVDIMM-N namespace into 'sector' /
> 'btt' mode. The crash points to this line:
>
> (gdb) li *(holder_class_store+0x253)
> 0x7773 is in holder_class_store
> (drivers/nvdimm/namespace_devs.c:1420).
> 1415 for (i = 0; i < nd_region->ndr_mappings; i++) {
> 1416 struct nd_mapping *nd_mapping =
> &nd_region->mapping[i];
> 1417 struct nvdimm_drvdata *ndd =
> to_ndd(nd_mapping);
> 1418 struct nd_namespace_index *nsindex;
> 1419
> 1420 nsindex = to_namespace_index(ndd, ndd-
> >ns_current);
>
> ...where we are failing because ndd is NULL due to NVDIMM-N dimms not
> supporting labels.
>
> Long story short, default to the BTTv1 format in the label-less /
> NVDIMM-N case.
>
> Fixes: 14e494542636 ("libnvdimm, btt: BTT updates for UEFI 2.7
> format")
> Cc: <stable@vger.kernel.org>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> Reported-by: Maurice A. Saldivar <maurice.a.saldivar@hpe.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> drivers/nvdimm/namespace_devs.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/nvdimm/namespace_devs.c
> b/drivers/nvdimm/namespace_devs.c
> index 1427a386a033..3e4d1e7998da 100644
> --- a/drivers/nvdimm/namespace_devs.c
> +++ b/drivers/nvdimm/namespace_devs.c
> @@ -1417,6 +1417,15 @@ static int btt_claim_class(struct device *dev)
> struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
> struct nd_namespace_index *nsindex;
>
> + /*
> + * If any of the DIMMs do not support labels the
> only
> + * possible BTT format is v1.
> + */
> + if (!ndd) {
> + loop_bitmask = 0;
> + break;
> + }
> +
> nsindex = to_namespace_index(ndd, ndd->ns_current);
> if (nsindex == NULL)
> loop_bitmask |= 1;
>
[toc] | [prev] | [next] | [standalone]
| From | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2017-09-20 00:20 +0200 |
| Subject | Re: [PATCH 2/2] libnvdimm, namespace: fix btt claim class crash |
| Message-ID | <urz21-2JM-13@gated-at.bofh.it> |
| In reply to | #1735290 |
On Tue, Sep 19, 2017 at 3:06 PM, Saldivar, Maurice A. <maurice.a.saldivar@hpe.com> wrote: > I applied this and the kernel patch and was successfully able to > configure an NVDIMM-N into sector mode. I do have a question about > specific behavior I observed. Before I was able to configure an NVDIMM > into any mode from any mode. With these patchs if I go to sector mode > and try going to memory or dax mode it fails with: > > # ndctl create-namespace -f -e namespace0.0 -m memory > Error: namespace0.0: sector_size: 4096 not supported > failed to reconfigure namespace: Invalid argument > > but if I go sector->raw-><mode> I can get into other modes fine. Was > this the intended behavior? > Nope, that's another bug. I'll fix that up.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web