* [PATCH] mtd: block2mtd: Add a valid holder to blkdev_put()
@ 2023-10-21 18:58 Richard Weinberger
2023-10-23 5:44 ` Christoph Hellwig
2023-10-27 17:47 ` Miquel Raynal
0 siblings, 2 replies; 3+ messages in thread
From: Richard Weinberger @ 2023-10-21 18:58 UTC (permalink / raw)
To: linux-mtd
Cc: linux-kernel, vigneshr, richard, miquel.raynal, joern,
Christoph Hellwig, stable
Since commit 2736e8eeb0ccd ("block: use the holder as indication for exclusive opens")
blkdev_put() requires a valid holder argument.
So, do so also in block2mtd to unbreak bdev->bd_holder refcounting.
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Fixes: 2736e8eeb0ccd ("block: use the holder as indication for exclusive opens")
Signed-off-by: Richard Weinberger <richard@nod.at>
---
drivers/mtd/devices/block2mtd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index be106dc20ff3c..8c37650bbce45 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -209,7 +209,7 @@ static void block2mtd_free_device(struct block2mtd_dev *dev)
if (dev->blkdev) {
invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping,
0, -1);
- blkdev_put(dev->blkdev, NULL);
+ blkdev_put(dev->blkdev, dev);
}
kfree(dev);
--
2.35.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: block2mtd: Add a valid holder to blkdev_put()
2023-10-21 18:58 [PATCH] mtd: block2mtd: Add a valid holder to blkdev_put() Richard Weinberger
@ 2023-10-23 5:44 ` Christoph Hellwig
2023-10-27 17:47 ` Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2023-10-23 5:44 UTC (permalink / raw)
To: Richard Weinberger
Cc: linux-mtd, linux-kernel, vigneshr, miquel.raynal, joern,
Christoph Hellwig, stable
On Sat, Oct 21, 2023 at 08:58:32PM +0200, Richard Weinberger wrote:
> Since commit 2736e8eeb0ccd ("block: use the holder as indication for exclusive opens")
Overly long line here.
> blkdev_put() requires a valid holder argument.
> So, do so also in block2mtd to unbreak bdev->bd_holder refcounting.
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: block2mtd: Add a valid holder to blkdev_put()
2023-10-21 18:58 [PATCH] mtd: block2mtd: Add a valid holder to blkdev_put() Richard Weinberger
2023-10-23 5:44 ` Christoph Hellwig
@ 2023-10-27 17:47 ` Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2023-10-27 17:47 UTC (permalink / raw)
To: Richard Weinberger, linux-mtd
Cc: Miquel Raynal, linux-kernel, vigneshr, joern, Christoph Hellwig,
stable
On Sat, 2023-10-21 at 18:58:32 UTC, Richard Weinberger wrote:
> Since commit 2736e8eeb0ccd ("block: use the holder as indication for exclusive opens")
> blkdev_put() requires a valid holder argument.
> So, do so also in block2mtd to unbreak bdev->bd_holder refcounting.
>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: stable@vger.kernel.org
> Fixes: 2736e8eeb0ccd ("block: use the holder as indication for exclusive opens")
> Signed-off-by: Richard Weinberger <richard@nod.at>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-27 17:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-21 18:58 [PATCH] mtd: block2mtd: Add a valid holder to blkdev_put() Richard Weinberger
2023-10-23 5:44 ` Christoph Hellwig
2023-10-27 17:47 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox