[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210715205920.2023980-2-mcgrof@kernel.org>
Date: Thu, 15 Jul 2021 13:59:09 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: axboe@...nel.dk
Cc: hare@...e.de, bvanassche@....org, ming.lei@...hat.com,
hch@...radead.org, jack@...e.cz, osandov@...com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>
Subject: [RFC 01/12] floppy: fix add_disk() assumption on exit
Even if the queue was cleaned up on exit,
putting the disk *is* still required, and
likewise, blk_cleanup_queue() on a null queue
should be a no-op now, after the patch titled
"block: skip queue if NULL on blk_cleanup_queue()"
so it is safe to use even if the queue is NULL.
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
drivers/block/floppy.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 87460e0e5c72..b68f4b6bf737 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4953,19 +4953,6 @@ static void __exit floppy_module_exit(void)
blk_cleanup_queue(disks[drive][i]->queue);
}
blk_mq_free_tag_set(&tag_sets[drive]);
-
- /*
- * These disks have not called add_disk(). Don't put down
- * queue reference in put_disk().
- */
- if (!(allowed_drive_mask & (1 << drive)) ||
- fdc_state[FDC(drive)].version == FDC_NONE) {
- for (i = 0; i < ARRAY_SIZE(floppy_type); i++) {
- if (disks[drive][i])
- disks[drive][i]->queue = NULL;
- }
- }
-
for (i = 0; i < ARRAY_SIZE(floppy_type); i++) {
if (disks[drive][i])
put_disk(disks[drive][i]);
--
2.27.0
Powered by blists - more mailing lists