From: Johannes Thumshirn <jthumshirn@suse.de>
To: Dave Jiang <dave.jiang@intel.com>, dan.j.williams@intel.com
Cc: linux-nvdimm@lists.01.org
Subject: Re: [PATCH 4/5] acpi_nfit, libnvdimm: Add support for clear poison list and bad blocks
Date: Tue, 7 Mar 2017 10:30:25 +0100 [thread overview]
Message-ID: <ca401cc3-db44-32a7-ecc5-2c06c0322177@suse.de> (raw)
In-Reply-To: <148883236818.49239.12371446691877974041.stgit@djiang5-desk3.ch.intel.com>
On 03/06/2017 09:32 PM, Dave Jiang wrote:
> Providing mechanism to clear poison list via the ndctl ND_CMD_CLEAR_ERROR
> call. We will update the poison list and also the badblocks at region level
> if the region is in dax mode or in pmem mode and not active.
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
[...]
> + if ((cmd != ND_CMD_CLEAR_ERROR) || !nvdimm_bus || !clear_err->cleared)
^~ Unnecessary parenthesis?
[...]
> +
> + /* make sure clear_err range is within a SPA range */
> + if (((clear_begin >= spa_begin) &&
> + (clear_begin < (spa_end))) &&
> + ((clear_end > spa_begin) &&
> + (clear_end <= spa_end))) {
Indentation looks a bit odd here and the superfluous parenthesis aren't
improving the situation.
[...]
> + if (nd_btt || nd_pfn || nd_dax) {
> + if (nd_btt)
> + ndns = nd_btt->ndns;
> + else if (nd_pfn)
> + ndns = nd_pfn->ndns;
> + else if (nd_dax)
> + ndns = nd_dax->nd_pfn.ndns;
> +
> + if (!ndns)
> + return 0;
How can this (the !ndns case) ever happen?
And anyways isn't this sufficient, or am I missing something:
if (nd_btt)
ndns = nd_btt->ndns;
else if (nd_pfn)
ndns = nd_pfn->ndns;
else if (nd_dax)
ndns = nd_dax->nd_pfn.ndns;
else
ndns = to_ndns(dev);
> + } else
> + ndns = to_ndns(dev);
> +
Thanks,
Johannes
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2017-03-07 9:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-06 20:32 [PATCH 0/5] Adding clear poison path for device DAX Dave Jiang
2017-03-06 20:32 ` [PATCH 1/5] libnvdimm: Add mechanism to publish badblocks at nd region level Dave Jiang
2017-03-07 8:58 ` Johannes Thumshirn
2017-03-06 20:32 ` [PATCH 2/5] libnvdimm: Add resource sysfs attrib to nd region Dave Jiang
2017-03-07 8:59 ` Johannes Thumshirn
2017-03-06 20:32 ` [PATCH 3/5] acpi: cleanup acpi_nfit_ctl calling xlat_status Dave Jiang
2017-03-08 0:20 ` Linda Knippers
2017-03-08 16:29 ` Dave Jiang
2017-03-08 16:51 ` Linda Knippers
2017-03-08 17:10 ` Dan Williams
2017-03-06 20:32 ` [PATCH 4/5] acpi_nfit, libnvdimm: Add support for clear poison list and bad blocks Dave Jiang
2017-03-07 9:30 ` Johannes Thumshirn [this message]
2017-03-07 16:00 ` Dave Jiang
2017-03-07 16:11 ` Johannes Thumshirn
2017-03-06 20:32 ` [PATCH 5/5] libnvdimm: providing dax support for nvdimm testing Dave Jiang
2017-03-07 9:31 ` Johannes Thumshirn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca401cc3-db44-32a7-ecc5-2c06c0322177@suse.de \
--to=jthumshirn@suse.de \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=linux-nvdimm@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox