Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Wei Yang
On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote: >In recent days, 2 engineers, including the original author of >nd_pfn_init(), overlooked the internal call to nd_pfn_validate() and the >implications to memory allocation. > >Clarify this situation to help anyone that reads through this

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Wei Yang
On Mon, Jan 21, 2019 at 04:45:46PM -0800, Dan Williams wrote: >On Mon, Jan 21, 2019 at 4:30 PM Wei Yang wrote: >> >> >> May I ask a question about the purpose to create these three device here? >> >> I see nd_pfn_create() doesn't allocate pfn_sb here, and the probe on these >> devices failed. Conf

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Dan Williams
On Mon, Jan 21, 2019 at 4:47 PM Wei Yang wrote: > > On Mon, Jan 21, 2019 at 04:29:08PM -0800, Dan Williams wrote: > >On Mon, Jan 21, 2019 at 4:26 PM Wei Yang > >wrote: > >[..] > >> >@@ -706,6 +711,22 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) > >> > sig = DAX_SIG; > >> >

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Wei Yang
On Mon, Jan 21, 2019 at 04:29:08PM -0800, Dan Williams wrote: >On Mon, Jan 21, 2019 at 4:26 PM Wei Yang wrote: >[..] >> >@@ -706,6 +711,22 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) >> > sig = DAX_SIG; >> > else >> > sig = PFN_SIG; >> >+ >> >+ /* >> >+

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Dan Williams
On Mon, Jan 21, 2019 at 4:30 PM Wei Yang wrote: > > On Mon, Jan 21, 2019 at 03:51:02PM +0800, Wei Yang wrote: > >On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote: > >>In recent days, 2 engineers, including the original author of > >>nd_pfn_init(), overlooked the internal call to nd_pfn

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Wei Yang
On Mon, Jan 21, 2019 at 03:51:02PM +0800, Wei Yang wrote: >On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote: >>In recent days, 2 engineers, including the original author of >>nd_pfn_init(), overlooked the internal call to nd_pfn_validate() and the >>implications to memory allocation. >>

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Dan Williams
On Mon, Jan 21, 2019 at 4:26 PM Wei Yang 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 > >

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Wei Yang
On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote: >In recent days, 2 engineers, including the original author of >nd_pfn_init(), overlooked the internal call to nd_pfn_validate() and the >implications to memory allocation. > >Clarify this situation to help anyone that reads through this

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Wei Yang
On Mon, Jan 21, 2019 at 02:34:06PM -0800, Dan Williams wrote: >On Mon, Jan 21, 2019 at 12:57 PM Wei Yang wrote: >> >> On Mon, Jan 21, 2019 at 10:04:40AM -0800, Dan Williams wrote: >> >On Sun, Jan 20, 2019 at 11:51 PM Wei Yang >> >wrote: >> >> On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan William

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Dan Williams
On Mon, Jan 21, 2019 at 12:57 PM Wei Yang wrote: > > On Mon, Jan 21, 2019 at 10:04:40AM -0800, Dan Williams wrote: > >On Sun, Jan 20, 2019 at 11:51 PM Wei Yang > >wrote: > >> On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote: > >[..] > >> Also, I have one confusion about your saying:

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Wei Yang
On Mon, Jan 21, 2019 at 10:04:40AM -0800, Dan Williams wrote: >On Sun, Jan 20, 2019 at 11:51 PM Wei Yang >wrote: >> On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote: >[..] >> Also, I have one confusion about your saying: two probes. >> >> If the two probes are: >> >> * for dax%d.%

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-21 Thread Dan Williams
On Sun, Jan 20, 2019 at 11:51 PM Wei Yang wrote: > On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote: [..] > Also, I have one confusion about your saying: two probes. > > If the two probes are: > > * for dax%d.%d: 1. nd_dax_probe 2. dax_pmem_probe > * for pfn%d.%d: 1. nd_pfn_pro

Re: [PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-20 Thread Wei Yang
On Fri, Jan 18, 2019 at 04:47:23PM -0800, Dan Williams wrote: >In recent days, 2 engineers, including the original author of >nd_pfn_init(), overlooked the internal call to nd_pfn_validate() and the >implications to memory allocation. > >Clarify this situation to help anyone that reads through this

[PATCH] libnvdimm: Clarify nd_pfn_init() flow

2019-01-18 Thread Dan Williams
In recent days, 2 engineers, including the original author of nd_pfn_init(), overlooked the internal call to nd_pfn_validate() and the implications to memory allocation. Clarify this situation to help anyone that reads through this code in the future. Reported-by: Wei Yang Signed-off-by: Dan Wil