> Reported-by: Sachin Sant <[email protected]> > Fixes: 87eb73b2ca7c ("nvdimm-pmem: convert to > blk_alloc_disk/blk_cleanup_disk") > Link: > http://lore.kernel.org/r/[email protected] > Cc: Christoph Hellwig <[email protected]> > Cc: Ulf Hansson <[email protected]> > Cc: Jens Axboe <[email protected]> > Signed-off-by: Dan Williams <[email protected]> > ---
Thanks Dan. This patch fixes the reported crash for me. Tested-by: Sachin Sant <[email protected]> > > Changes in v2 Improve the changelog. > > drivers/nvdimm/pmem.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c > index 31f3c4bd6f72..fc6b78dd2d24 100644 > --- a/drivers/nvdimm/pmem.c > +++ b/drivers/nvdimm/pmem.c > @@ -337,8 +337,9 @@ static void pmem_pagemap_cleanup(struct dev_pagemap > *pgmap) > { > struct request_queue *q = > container_of(pgmap->ref, struct request_queue, q_usage_counter); With this change variable ‘q' is no longer needed and can be removed. drivers/nvdimm/pmem.c: In function 'pmem_pagemap_cleanup': drivers/nvdimm/pmem.c:338:24: warning: unused variable 'q' [-Wunused-variable] struct request_queue *q = ^ > + struct pmem_device *pmem = pgmap->owner; > > - blk_cleanup_disk(queue_to_disk(q)); > + blk_cleanup_disk(pmem->disk); > } > > static void pmem_release_queue(void *pgmap) > @@ -427,6 +428,7 @@ static int pmem_attach_disk(struct device *dev, > q = disk->queue; > > pmem->disk = disk; > + pmem->pgmap.owner = pmem; > pmem->pfn_flags = PFN_DEV; > pmem->pgmap.ref = &q->q_usage_counter; > if (is_nd_pfn(dev)) { > Thanks -Sachin
