All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sd: don't call blk_cleanup_disk in sd_probe
@ 2022-05-23  8:38 Christoph Hellwig
  2022-05-24  3:16 ` Martin K. Petersen
  2022-05-24 18:11 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2022-05-23  8:38 UTC (permalink / raw)
  To: martin.petersen; +Cc: haowenchao, linux-scsi

In SCSI the midlayer has ownership of the request_queue, so on probe
failure we must only put the gendisk, but leave the request_queue alone.

Fixes: 03252259e18e ("scsi: sd: Clean up gendisk if device_add_disk() failed")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9694e2cfaf9a6..986de990cf0f7 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3473,7 +3473,7 @@ static int sd_probe(struct device *dev)
 	error = device_add_disk(dev, gd, NULL);
 	if (error) {
 		put_device(&sdkp->disk_dev);
-		blk_cleanup_disk(gd);
+		put_disk(gd);
 		goto out;
 	}
 
-- 
2.30.2


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

* Re: [PATCH] sd: don't call blk_cleanup_disk in sd_probe
  2022-05-23  8:38 [PATCH] sd: don't call blk_cleanup_disk in sd_probe Christoph Hellwig
@ 2022-05-24  3:16 ` Martin K. Petersen
  2022-05-24 18:11 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-05-24  3:16 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: martin.petersen, haowenchao, linux-scsi


Christoph,

> In SCSI the midlayer has ownership of the request_queue, so on probe
> failure we must only put the gendisk, but leave the request_queue alone.

Applied to 5.19/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] sd: don't call blk_cleanup_disk in sd_probe
  2022-05-23  8:38 [PATCH] sd: don't call blk_cleanup_disk in sd_probe Christoph Hellwig
  2022-05-24  3:16 ` Martin K. Petersen
@ 2022-05-24 18:11 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-05-24 18:11 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Martin K . Petersen, linux-scsi, haowenchao

On Mon, 23 May 2022 10:38:13 +0200, Christoph Hellwig wrote:

> In SCSI the midlayer has ownership of the request_queue, so on probe
> failure we must only put the gendisk, but leave the request_queue alone.
> 
> 

Applied to 5.19/scsi-queue, thanks!

[1/1] sd: don't call blk_cleanup_disk in sd_probe
      https://git.kernel.org/mkp/scsi/c/7274ce0558ad

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2022-05-24 18:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23  8:38 [PATCH] sd: don't call blk_cleanup_disk in sd_probe Christoph Hellwig
2022-05-24  3:16 ` Martin K. Petersen
2022-05-24 18:11 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.