From: Ross Zwisler <ross.zwisler@linux.intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH] ndctl: add a BTT check utility
Date: Mon, 23 Jan 2017 10:42:57 -0700 [thread overview]
Message-ID: <20170123174257.GA19362@linux.intel.com> (raw)
In-Reply-To: <CAPcyv4gU5ujYJt0PLbNb4t64vRCnXhBxhfdB9ineZmgdAys2vg@mail.gmail.com>
On Fri, Jan 20, 2017 at 12:04:46PM -0800, Dan Williams wrote:
> [ adding Jeff ]
>
> Some comments on boilerplate / organization items...
>
>
> On Thu, Jan 19, 2017 at 7:12 PM, Vishal Verma <vishal.l.verma@intel.com> wrote:
> > Add the check-namespace command to ndctl. This will check the BTT
> > metadata layout for the given namespace, and if requested, correct any
> > errors found. Not all metadata corruption is detectable or fixable.
> >
> > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
<>
> > +static int btt_read_info(struct btt_chk *bttc, struct btt_sb *btt_sb, __u64 off)
> > +{
> > + int fd, rc = 0;
> > + ssize_t size;
> > +
> > + fd = open(bttc->path, O_RDONLY);
>
> Let's not open and close the btt device on each call. Open it once at
> the beginning of time and open it O_EXCL so that we prevent the kernel
> trying to claim the device. Let's also use O_DIRECT to bypass the
> block_device page cache.
I thought O_EXCL only mattered if it was used for creation of new files with
O_CREAT?
https://linux.die.net/man/3/open
For us bttc->path is our device in /dev/, so that O_EXCL shouldn't do anything
for us?
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2017-01-23 17:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 3:12 [PATCH] ndctl: add a BTT check utility Vishal Verma
2017-01-20 20:04 ` Dan Williams
2017-01-23 17:42 ` Ross Zwisler [this message]
2017-01-23 17:49 ` Dan Williams
2017-01-20 21:00 ` Linda Knippers
2017-01-24 22:58 ` Verma, Vishal L
[not found] ` <20170120031234.24226-1-vishal.l.verma-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-01-20 23:14 ` Jeff Moyer
[not found] ` <x49lgu52uk0.fsf-RRHT56Q3PSP4kTEheFKJxxDDeQx5vsVwAInAS/Ez/D0@public.gmane.org>
2017-01-21 0:41 ` Verma, Vishal L
[not found] ` <1484959224.4857.6.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-01-23 18:20 ` Jeff Moyer
[not found] ` <x49vat5ljtz.fsf-RRHT56Q3PSP4kTEheFKJxxDDeQx5vsVwAInAS/Ez/D0@public.gmane.org>
2017-01-24 20:59 ` Verma, Vishal L
2017-01-31 0:12 ` 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=20170123174257.GA19362@linux.intel.com \
--to=ross.zwisler@linux.intel.com \
--cc=dan.j.williams@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