From: Wei Yang <richardw.yang@linux.intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Wei Yang <richardw.yang@linux.intel.com>,
linux-nvdimm <linux-nvdimm@lists.01.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow
Date: Tue, 22 Jan 2019 08:46:47 +0800 [thread overview]
Message-ID: <20190122004647.GA6575@richard> (raw)
In-Reply-To: <CAPcyv4jXS-doCdyTrcV3DL63N-q4m1H2=Msgm1z88HnF8bcEig@mail.gmail.com>
On Mon, Jan 21, 2019 at 04:29:08PM -0800, Dan Williams wrote:
>On Mon, Jan 21, 2019 at 4:26 PM Wei Yang <richardw.yang@linux.intel.com> wrote:
>[..]
>> >@@ -706,6 +711,22 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn)
>> > sig = DAX_SIG;
>> > else
>> > sig = PFN_SIG;
>> >+
>> >+ /*
>> >+ * Check for an existing 'pfn' superblock before writing a new
>> >+ * one. The intended flow is that on the first probe of an
>> >+ * nd_{pfn,dax} device the superblock is calculated and written
>> >+ * to the namespace. In this case nd_pfn_validate() returns
>> >+ * -ENODEV because no valid superblock exists currently.
>>
>> As you replied in following mail:
>>
>> 3/ If present, nd_pfn_validate() returns 0 and nd_dax_probe()
>> registers the dax0.1 device (this is a libnvdimm 'personality device).
>>
>> So at this point, nd_pfn_validate() return 0 or -ENODEV?
>
>In this case 0, because the configuration was successfully validated.
>
>-ENODEV, is only returned for the initial case where we want the
>kernel to write the configuration.
>
>All other error codes are an actual failure and the probe procedure stops.
To be honest, this maybe crystal clear for you. But I still feel a little
confused. Especially on differentiating those cases. How many cases we have?
And what's your first probe mean? This the nd_btt/pfn/dax_probe()? or the
linux driver probe?
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2019-01-22 0:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-19 0:47 [PATCH] libnvdimm: Clarify nd_pfn_init() flow Dan Williams
2019-01-21 7:51 ` Wei Yang
2019-01-21 18:04 ` Dan Williams
2019-01-21 20:57 ` Wei Yang
2019-01-21 22:34 ` Dan Williams
2019-01-22 0:23 ` Wei Yang
2019-01-22 0:29 ` Wei Yang
2019-01-22 0:45 ` Dan Williams
2019-01-22 3:13 ` Wei Yang
2019-01-22 0:26 ` Wei Yang
2019-01-22 0:29 ` Dan Williams
2019-01-22 0:46 ` Wei Yang [this message]
2019-01-22 1:00 ` Dan Williams
2019-01-22 3:35 ` Wei Yang
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=20190122004647.GA6575@richard \
--to=richardw.yang@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--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