From: "Verma, Vishal L" <vishal.l.verma-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
<jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org"
<linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org>
Subject: Re: [ndctl PATCH v2 3/3] ndctl, test: Add a unit test for the BTT checker
Date: Tue, 28 Feb 2017 21:49:49 +0000 [thread overview]
Message-ID: <1488318514.4873.12.camel@intel.com> (raw)
In-Reply-To: <x494lze10ae.fsf-RRHT56Q3PSP4kTEheFKJxxDDeQx5vsVwAInAS/Ez/D0@public.gmane.org>
On Tue, 2017-02-28 at 16:19 -0500, Jeff Moyer wrote:
> Vishal Verma <vishal.l.verma-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> writes:
>
> > +# re-enable the BTT namespace, and do IO to it in an attempt to
> > +# verify it still comes up ok, and functions as expected
> > +post_repair_test()
> > +{
> > + echo "${FUNCNAME[0]}: I/O to BTT namespace"
> > + test -b /dev/$blockdev
> > + dd if=/dev/zero of=/dev/$blockdev bs=$sector_size
> > count=$((size/sector_size)) > /dev/null 2>&1
> > + dd if=/dev/$blockdev of=/dev/null bs=$sector_size
> > count=$((size/sector_size)) > /dev/null 2>&1
>
> Maybe validate the data you got?
Good idea, I was just testing that the IOs don't fail, but I'll add
writing known data and validating it is read back the same.
>
> > + echo "done"
> > +}
> > +
> > +test_normal()
> > +{
> > + echo "=== ${FUNCNAME[0]} ==="
> > + # disable the namespace
> > + $ndctl disable-namespace $dev
> > + $ndctl check-namespace $dev
>
> Shouldn't we ensure there are no errors reported by the check?
It should happen already. Check-namespace will return a non zero exit
code for any errors, and that will trigger the script's set -E error
trap.
>
> > + $ndctl enable-namespace $dev
> > + post_repair_test
> > +}
> > +
>
> [snip]
>
> > +test_bitmap()
> > +{
> > + echo "=== ${FUNCNAME[0]} ==="
> > + reset && create
> > + set_raw
> > + # scribble over the last 4K of the map
> > + rm -f /tmp/scribble
> > + for (( i=0 ; i<512 ; i++ )); do
> > + echo -n -e \\x1e\\x1e\\x00\\xc0\\x1e\\x1e\\x00\\xc0
> > >> /tmp/scribble
> > + done
> > + seek="$((raw_size/bs - (256*64/bs) - 2))"
> > + echo "scribbling over map entries (offset = $seek blocks)"
> > + dd if=/tmp/scribble of=/dev/$raw_bdev bs=$bs seek=$seek
> > + rm -f /tmp/scribble
> > + unset_raw
> > + $ndctl disable-namespace $dev
> > + $ndctl check-namespace $dev 2>&1 | grep "bitmap error"
> > + # This is not repairable
> > + reset && create
> > +}
> > +
>
> Can you add a test to inject badblocks in the metadata?
I had been putting off badblock handling with BTT metadata, but you're
right, let me figure out a flow for how to handle/report this. Obviously
recovery is not possible at that point, but we should be able to provide
a coherent message.
>
> Cheers,
> Jeff
next prev parent reply other threads:[~2017-02-28 21:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-22 22:47 [ndctl PATCH v2 0/3] Add ndctl check-namespace Vishal Verma
2017-02-22 22:47 ` [ndctl PATCH v2 1/3] ndctl: move the fletcher64 routine to util/ Vishal Verma
2017-02-22 22:47 ` [ndctl PATCH v2 2/3] ndctl: add a BTT check utility Vishal Verma
2017-02-24 1:14 ` Dan Williams
2017-02-28 21:11 ` Jeff Moyer
[not found] ` <x49a89610mr.fsf-RRHT56Q3PSP4kTEheFKJxxDDeQx5vsVwAInAS/Ez/D0@public.gmane.org>
2017-02-28 22:31 ` Verma, Vishal L
[not found] ` <1488321002.4873.17.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-03-01 15:02 ` Jeff Moyer
[not found] ` <x49inntt4z6.fsf-RRHT56Q3PSP4kTEheFKJxxDDeQx5vsVwAInAS/Ez/D0@public.gmane.org>
2017-03-01 15:54 ` Dan Williams
[not found] ` <CAPcyv4g+UfCR2x3KwWB+yu6fRh5UcVRvdAdrx3ri8bpJx+r8YQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-01 20:27 ` Verma, Vishal L
2017-03-01 20:26 ` Verma, Vishal L
2017-02-22 22:47 ` [ndctl PATCH v2 3/3] ndctl, test: Add a unit test for the BTT checker Vishal Verma
[not found] ` <20170222224724.7696-4-vishal.l.verma-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-02-28 21:19 ` Jeff Moyer
[not found] ` <x494lze10ae.fsf-RRHT56Q3PSP4kTEheFKJxxDDeQx5vsVwAInAS/Ez/D0@public.gmane.org>
2017-02-28 21:49 ` Verma, Vishal L [this message]
[not found] ` <1488318514.4873.12.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-02-28 21:58 ` Jeff Moyer
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=1488318514.4873.12.camel@intel.com \
--to=vishal.l.verma-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.