From: "Kani, Toshimitsu" <toshi.kani@hpe.com>
To: "dan.j.williams@intel.com" <dan.j.williams@intel.com>,
"dave.jiang@intel.com" <dave.jiang@intel.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH v5] ndctl: add clear error support for ndctl
Date: Tue, 2 May 2017 21:21:37 +0000 [thread overview]
Message-ID: <1493760092.30303.42.camel@hpe.com> (raw)
In-Reply-To: <CAPcyv4jYsPCvp5_kgVvGxGy-YT84ADM2QdCRSwGh3kLB+pzeqQ@mail.gmail.com>
On Tue, 2017-05-02 at 13:54 -0700, Dan Williams wrote:
> On Tue, May 2, 2017 at 1:26 PM, Dave Jiang <dave.jiang@intel.com>
> wrote:
:
> > +read sector len <
> > /sys/bus/platform/devices/nfit_test.0/$dev/$region/badblocks
> > +echo "sector: $sector len: $len"
> > +
> > +# clearing using ndctl
> > +$NDCTL clear-error -f /dev/$chardev -s $sector -l $len
>
> Ok, so I'm glad you wrote this test it highlights one mismatched
> assumption. The "ndctl clear-error" options should be device-
> relative "sector" offsets not region offsets. So, "ndctl clear-error
> /dev/dev0.0 -s 0" should clear device-dax instance offset 0, not
> region offset 0 A device-dax instance starts at an offset from the
> namespace, and the namespace may start anywhere within a region. So
> the clear-error command needs to translate that device-dax sector
> offset to the region offset. device-dax offset to namespace offset
> can be calculated by subtracting the device-dax instance size from
> the namespace size, the namespace offset can be calculated by
> subtracting the region resource base from the namespace resource
> base. Now, the difficulty will be that the resource values for
> nfit_test are garbage because they are vmalloc'd based, I need to
> give that some thought...
Using device-relative sector makes sense, but how does user come up
with this sector number when sysfs only provides regionN/badblocks?
Thanks,
-Toshi
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2017-05-02 21:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 20:26 [PATCH v5] ndctl: add clear error support for ndctl Dave Jiang
2017-05-02 20:54 ` Dan Williams
2017-05-02 21:21 ` Kani, Toshimitsu [this message]
2017-05-02 21:24 ` Dan Williams
2017-05-02 23:54 ` Vishal Verma
2017-05-03 0:08 ` Dave Jiang
2017-05-03 0:11 ` Verma, Vishal L
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=1493760092.30303.42.camel@hpe.com \
--to=toshi.kani@hpe.com \
--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