Re: [PATCH] pstore/ram: Clarify resource reservation labels
From: Dan Williams
Date: Thu Oct 18 2018 - 18:49:17 EST
On Thu, Oct 18, 2018 at 3:43 PM Luck, Tony <tony.luck@xxxxxxxxx> wrote:
> > If the filesystem existed on the namespace before the user specified
> > the ramoops command line then ramoops will clobber the filesystem and
> > the user will only find out when mount later fails. All the kernel
> > will say is:
> > dev_warn(dev, "could not reserve region %pR\n", res);
> > ...from the pmem driver, and then the only way to figure who the
> > conflict is with is to look at /proc/iomem, but the damage is already
> > likely done by that point.
> When you set up a ramoops region in pmem, write a magic header block
> at the start of the area. Then when pstore/ramoops goes to find the
> region, it checks for the magic header. Not there? Don't write to the
> region. Problem solved.
That's effectively what this registration proposal will do. However,
with the caveat that the user never gets to write that magic header
without going through the nvdimm infrastructure to set it up, and
assert there is nothing there already.