linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build warning after merge of the block tree
@ 2021-06-09  3:52 Stephen Rothwell
  2021-06-09  4:28 ` Dan Williams
  2021-06-09  4:37 ` [PATCH] libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning Dan Williams
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Rothwell @ 2021-06-09  3:52 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Dan Williams, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

Hi all,

After merging the block tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

drivers/nvdimm/pmem.c: In function 'pmem_pagemap_cleanup':
drivers/nvdimm/pmem.c:338:24: warning: unused variable 'q' [-Wunused-variable]
  338 |  struct request_queue *q =
      |                        ^

Introduced by commit

  80b58f4e9f4a ("libnvdimm/pmem: Fix blk_cleanup_disk() usage")

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: build warning after merge of the block tree
  2021-06-09  3:52 linux-next: build warning after merge of the block tree Stephen Rothwell
@ 2021-06-09  4:28 ` Dan Williams
  2021-06-09  4:37 ` [PATCH] libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning Dan Williams
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Williams @ 2021-06-09  4:28 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Jens Axboe, Linux Kernel Mailing List, Linux Next Mailing List

On Tue, Jun 8, 2021 at 8:52 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> After merging the block tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> drivers/nvdimm/pmem.c: In function 'pmem_pagemap_cleanup':
> drivers/nvdimm/pmem.c:338:24: warning: unused variable 'q' [-Wunused-variable]
>   338 |  struct request_queue *q =
>       |                        ^
>

Ugh, I should have caught this... fix incoming.

> Introduced by commit
>
>   80b58f4e9f4a ("libnvdimm/pmem: Fix blk_cleanup_disk() usage")
>
> --
> Cheers,
> Stephen Rothwell

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning
  2021-06-09  3:52 linux-next: build warning after merge of the block tree Stephen Rothwell
  2021-06-09  4:28 ` Dan Williams
@ 2021-06-09  4:37 ` Dan Williams
  2021-06-09 15:10   ` Jens Axboe
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Williams @ 2021-06-09  4:37 UTC (permalink / raw)
  To: axboe; +Cc: Stephen Rothwell, linux-block, nvdimm, linux-kernel

The recent fix to pmem_pagemap_cleanup() to solve a NULL pointer
dereference with the queue_to_disk() helper neglected to remove the @q
variable when queue_to_disk() was replaced.

Drop the conversion of @pgmap to its containing 'struct request_queue'
since pgmap->owner supersedes the need to reference @q.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 80b58f4e9f4a ("libnvdimm/pmem: Fix blk_cleanup_disk() usage")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/nvdimm/pmem.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index fc6b78dd2d24..1e0615b8565e 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -335,8 +335,6 @@ static const struct attribute_group *pmem_attribute_groups[] = {
 
 static void pmem_pagemap_cleanup(struct dev_pagemap *pgmap)
 {
-	struct request_queue *q =
-		container_of(pgmap->ref, struct request_queue, q_usage_counter);
 	struct pmem_device *pmem = pgmap->owner;
 
 	blk_cleanup_disk(pmem->disk);


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning
  2021-06-09  4:37 ` [PATCH] libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning Dan Williams
@ 2021-06-09 15:10   ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-06-09 15:10 UTC (permalink / raw)
  To: Dan Williams; +Cc: Stephen Rothwell, linux-block, nvdimm, linux-kernel

On 6/8/21 10:37 PM, Dan Williams wrote:
> The recent fix to pmem_pagemap_cleanup() to solve a NULL pointer
> dereference with the queue_to_disk() helper neglected to remove the @q
> variable when queue_to_disk() was replaced.
> 
> Drop the conversion of @pgmap to its containing 'struct request_queue'
> since pgmap->owner supersedes the need to reference @q.

I folded this in.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-09 15:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  3:52 linux-next: build warning after merge of the block tree Stephen Rothwell
2021-06-09  4:28 ` Dan Williams
2021-06-09  4:37 ` [PATCH] libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning Dan Williams
2021-06-09 15:10   ` Jens Axboe

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).