nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Sachin Sant <sachinp@linux.vnet.ibm.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: axboe@kernel.dk, nvdimm@lists.linux.dev,
	Ulf Hansson <ulf.hansson@linaro.org>,
	linux-block@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2] libnvdimm/pmem: Fix blk_cleanup_disk() usage
Date: Tue, 8 Jun 2021 11:13:31 +0530	[thread overview]
Message-ID: <637B91E6-B4DD-4DF3-BAA2-0C60B6B6B3C5@linux.vnet.ibm.com> (raw)
In-Reply-To: <162310994435.1571616.334551212901820961.stgit@dwillia2-desk3.amr.corp.intel.com>


> Reported-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
> Fixes: 87eb73b2ca7c ("nvdimm-pmem: convert to blk_alloc_disk/blk_cleanup_disk")
> Link: http://lore.kernel.org/r/DFB75BA8-603F-4A35-880B-C5B23EF8FA7D@linux.vnet.ibm.com
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---

Thanks Dan. This patch fixes the reported crash for me.

Tested-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
> 
> 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

  parent reply	other threads:[~2021-06-08  6:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 23:31 [PATCH] " Dan Williams
2021-06-07 23:52 ` [PATCH v2] " Dan Williams
2021-06-08  5:36   ` Christoph Hellwig
2021-06-08  5:43   ` Sachin Sant [this message]
2021-06-08 21:26   ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=637B91E6-B4DD-4DF3-BAA2-0C60B6B6B3C5@linux.vnet.ibm.com \
    --to=sachinp@linux.vnet.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=dan.j.williams@intel.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=ulf.hansson@linaro.org \
    --subject='Re: [PATCH v2] libnvdimm/pmem: Fix blk_cleanup_disk() usage' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).