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

Re: [PATCH] libnvdimm, pfn: not allocate nd_pfn->pfn_sb if already allocated

2019-01-20 Thread Dan Williams
On Sun, Jan 20, 2019 at 4:51 PM Wei Yang wrote: [..] > >I also don't see that this fix is needed. nd_dax_probe() > >devm-allocates pfn_sb and performs a validation. If the validation > >succeeds nd_dax_probe() returns 0 which creates a new device and then > >causes nd_pmem_probe() to fail. At that

Re: [PATCH] libnvdimm, pfn: not allocate nd_pfn->pfn_sb if already allocated

2019-01-20 Thread Wei Yang
On Fri, Jan 18, 2019 at 10:59:23AM -0800, Dan Williams wrote: >On Fri, Jan 18, 2019 at 12:38 AM Dan Williams wrote: >> >> On Thu, Jan 17, 2019 at 11:31 PM Wei Yang >> wrote: >> > >> > On Thu, Jan 17, 2019 at 09:05:54PM -0800, Dan Williams wrote: >> > >On Thu, Jan 17, 2019 at 9:03 PM Wei Yang >

Re: [PATCH] libnvdimm, pfn: not allocate nd_pfn->pfn_sb if already allocated

2019-01-20 Thread Wei Yang
On Fri, Jan 18, 2019 at 12:38:18AM -0800, Dan Williams wrote: >On Thu, Jan 17, 2019 at 11:31 PM Wei Yang >wrote: >> >> On Thu, Jan 17, 2019 at 09:05:54PM -0800, Dan Williams wrote: >> >On Thu, Jan 17, 2019 at 9:03 PM Wei Yang >> >wrote: >> >> >> >> On Thu, Jan 17, 2019 at 08:31:56PM -0800, Dan