From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "linda.knippers@hpe.com" <linda.knippers@hpe.com>,
"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH v3 6/7] ndctl: add a BTT check utility
Date: Tue, 14 Mar 2017 19:23:45 +0000 [thread overview]
Message-ID: <1489519422.2541.2.camel@intel.com> (raw)
In-Reply-To: <58C72AA6.1020700@hpe.com>
On Mon, 2017-03-13 at 19:26 -0400, Linda Knippers wrote:
> Hi Vishal,
>
> Thanks for all your work on this. I finally got a chance to do some
> testing and have a few usability suggestions for you to consider.
Thanks for the comments, Linda. See below, but yes I can send follow on
patches for these.
>
> On 03/04/2017 01:13 AM, Vishal Verma wrote:
> <snip>
> >
> > */
> > + raw_mode = ndctl_namespace_get_raw_mode(ndns);
> > +
> > + /*
> > + * Putting the namespace into raw mode will allow us to
> > access
> > + * the btt metadata.
> > + */
> > + rc = ndctl_namespace_set_raw_mode(ndns, 1);
> > + if (rc < 0) {
> > + err(bttc, "%s: failed to set the raw mode flag:
> > %d\n",
> > + devname, rc);
> > + goto out_ns;
> > + }
>
> When I ran the utility as non-root, I got this:
> $ ndctl check-namespace namespace3.0
> namespace3.0: namespace_check: namespace3.0: failed to set the raw
> mode flag: -6
> error checking namespaces: No such device or address
>
> I think it ought to end with Permission denied, which it would do if
> ndctl_namespace_get_raw_mode() returned with -errno rather than a
> hard
> coded ENXIO.
Good point - I'll fix this (in a follow on patch).
>
> If that's main reason that setting the raw mode flag can fail, then
> the
> err() could be an info(). That would simplify the output.
I think it should still be an error as it is a fatal problem and we
have to abort..
<snip>
> > +
> > + rc = btt_info_read_verify(bttc, btt_sb, bttc->start_off);
> > + if (rc) {
> > + rc = btt_recover_first_sb(bttc);
> > + if (rc) {
> > + info(bttc, "Unable to recover any BTT info
> > blocks\n");
> > + goto out_close;
>
> When I ran this on a namespace that never had a BTT, I thought I'd
> get a error
> basically saying that I'm screwed, but instead I got:
>
> $ sudo ndctl check-namespace namespace1.0
> error checking namespaces: No such device or address
>
> It seems like the info() above is rather important and should be an
> err().
> For a checker, maybe verbose should be the default anyway.
Ok - let me revisit the no BTT case and see if we can print out
something better.
>
> > + }
> > + rc = btt_info_read_verify(bttc, btt_sb, bttc-
> > >start_off);
> > + if (rc)
> > + goto out_close;
> > + }
> > + rc = btt_discover_arenas(bttc);
> > + if (rc)
> > + goto out_close;
> > +
> > + rc = btt_create_mappings(bttc);
> > + if (rc)
> > + goto out_close;
> > +
> > + rc = btt_check_arenas(bttc);
> > +
> > + btt_remove_mappings(bttc);
> > + out_close:
> > + close(bttc->fd);
> > + out_sb:
> > + free(btt_sb);
> > + out_ns:
> > + ndctl_namespace_set_raw_mode(ndns, raw_mode);
> > + ndctl_namespace_disable_invalidate(ndns);
> > + if (disabled_flag)
> > + if(ndctl_namespace_enable(ndns) < 0)
> > + info(bttc, "%s: failed to re-enable
> > namespace\n",
> > + devname);
>
> I didn't get this error but it seems rather important too.
This should normally never happen, and I had it as an info because at
this point we can't really do anything about it. Any check/repair has
already completed, and if we weren't able to enable the namespace, the
user likely won't either for the same reason.. In any case, it seems
more like an informational message since nothing can be done about it,
and it doesn't affect any future flow..
>
> Thanks,
>
> - ljk
>
> > + out_bttc:
> > + free(bttc);
> > + return rc;
> > +}
>
>
_______________________________________________
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-14 19:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-04 6:13 [ndctl PATCH v3 0/7] Add ndctl check-namespace Vishal Verma
2017-03-04 6:13 ` [ndctl PATCH v3 1/7] libndctl: add a ndctl_namespace_is_active helper Vishal Verma
2017-03-04 6:13 ` [ndctl PATCH v3 2/7] libndctl: add a ndctl_namespace_disable_safe() API Vishal Verma
2017-03-04 6:13 ` [ndctl PATCH v3 3/7] ccan: Add ccan/bitmap in preparation for the BTT checker Vishal Verma
2017-04-01 15:53 ` Dan Williams
2017-03-04 6:13 ` [ndctl PATCH v3 4/7] ccan/bitmap: fix a set of gcc warnings (with -Wshadow) Vishal Verma
2017-03-04 6:13 ` [ndctl PATCH v3 5/7] ndctl: move the fletcher64 routine to util/ Vishal Verma
2017-03-04 6:13 ` [ndctl PATCH v3 6/7] ndctl: add a BTT check utility Vishal Verma
2017-03-13 23:26 ` Linda Knippers
2017-03-14 19:23 ` Verma, Vishal L [this message]
2017-03-14 19:52 ` Linda Knippers
2017-03-04 6:13 ` [ndctl PATCH v3 7/7] ndctl, test: Add a unit test for the BTT checker Vishal Verma
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=1489519422.2541.2.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=linda.knippers@hpe.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 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.