Re: [PATCH 2/2] dax: fix bdev NULL pointer dereferences

From: Matthew Wilcox
Date: Mon Feb 01 2016 - 08:44:13 EST


On Sun, Jan 31, 2016 at 01:32:47PM +1100, Matthew Wilcox wrote:
> On Fri, Jan 29, 2016 at 10:01:13PM -0800, Dan Williams wrote:
> > On Fri, Jan 29, 2016 at 9:28 PM, Matthew Wilcox <willy@xxxxxxxxxxxxxxx> wrote:
> > > If we store the PFN of the underlying page instead, we don't have this
> > > problem. Instead, we have a different problem; of the device going
> > > away under us. I'm trying to find the code which tears down PTEs when
> > > the device goes away, and I'm not seeing it. What do we do about user
> > > mappings of the device?
> >
> > I deferred the dax tear down code until next cycle as Al rightly
> > pointed out some needed re-works:
> >
> > https://lists.01.org/pipermail/linux-nvdimm/2016-January/003995.html
>
> Thanks; I eventually found it in my email somewhere over the Pacific.
>
> I did probably 70% of the work needed to switch the radix tree over to
> storing PFNs instead of sectors. It seems viable, though it's a big
> change from where we are today:

70%?! Hah. I'd done maybe 50%. This isn't everything needed; I still
need to write radix_tree_replace(). But it's enough to get a flavour for
where this line of thinking takes us. I think it ends up being cleaner
code, and possibly better performing. I also think it points us back
in the direction of wanting an address_space operation to return a PFN
for the radix tree instead of handling buffer_heads directly in dax.c.

Ah well. Time to sleep ...