On Thu, Jan 17, 2019 at 7:36 PM Wei Yang <[email protected]> wrote:
>
> In current implementation, we might re-allocate nd_pfn->pfn_sb.
>
> For example:
>
>     nd_dax_probe()
>         nd_pfn->pfn_sb = devm_kzalloc()
>
>     dax_pmem_probe()
>         nvdimm_setup_pfn()
>             nd_pfn_init()
>                 nd_pfn->pfn_sb = devm_kzalloc()
>
> This patch checks nd_pfn->pfn_sb before allocating it in nd_pfn_init().

Ugh, this patch is unfortunately uncovering a deeper problem.
nvdimm_setup_pfn() should not be calling nd_pfn_init(). This
effectively is always re-initializing the info-block, benign but
unnecessary. Instead it needs to be using nd_pfn_validate() followed
by an __nvdimm_setup_pfn() in the dax_pmem_probe() path.

Good find!
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to