fully tear down the queue in del_gendisk
Subsystems (38)
Christoph Hellwig
maintainerHi Jens,
this series simplifies teardown for most block drivers. Right now they also have to call blk_cleanup_queue after calling del_gendisk, making the teardown process rather confusing.
Instead this series records if the request_queue is owned by the gendisk, which is always the case except for scsi and dasd or queues without a gendisk at all, and then does the entire teardown in del_gendisk.
Note that while intended or 5.20, this series is generated against the block-5.19 branch as that contains fixes in this area that haven't made it to the for-5.10/block branch yet.
Diffstat:
arch/m68k/emu/nfblock.c | 4 arch/um/drivers/ubd_kern.c | 4 arch/xtensa/platforms/iss/simdisk.c | 4 block/blk-core.c | 43 ----- block/blk-mq-debugfs.c | 8 block/blk-mq.c | 43 ++++- block/blk-sysfs.c | 5 block/blk.h | 3 block/bsg-lib.c | 4 block/genhd.c | 38 +--- drivers/block/amiflop.c | 2 drivers/block/aoe/aoeblk.c | 2 drivers/block/aoe/aoedev.c | 2 drivers/block/ataflop.c | 5 drivers/block/brd.c | 4 drivers/block/drbd/drbd_main.c | 4 drivers/block/floppy.c | 6 drivers/block/loop.c | 3 drivers/block/mtip32xx/mtip32xx.c | 298 +++++------------------------------- drivers/block/mtip32xx/mtip32xx.h | 5 drivers/block/n64cart.c | 2 drivers/block/nbd.c | 4 drivers/block/null_blk/main.c | 4 drivers/block/paride/pcd.c | 4 drivers/block/paride/pd.c | 4 drivers/block/paride/pf.c | 4 drivers/block/pktcdvd.c | 4 drivers/block/ps3disk.c | 4 drivers/block/ps3vram.c | 4 drivers/block/rbd.c | 2 drivers/block/rnbd/rnbd-clt.c | 6 drivers/block/sunvdc.c | 4 drivers/block/swim.c | 2 drivers/block/swim3.c | 2 drivers/block/sx8.c | 6 drivers/block/virtio_blk.c | 3 drivers/block/xen-blkfront.c | 4 drivers/block/z2ram.c | 3 drivers/block/zram/zram_drv.c | 4 drivers/cdrom/gdrom.c | 3 drivers/md/bcache/super.c | 2 drivers/md/dm.c | 2 drivers/md/md.c | 4 drivers/memstick/core/ms_block.c | 3 drivers/memstick/core/mspro_block.c | 3 drivers/mmc/core/block.c | 1 drivers/mmc/core/queue.c | 1 drivers/mtd/mtd_blkdevs.c | 4 drivers/mtd/ubi/block.c | 4 drivers/nvdimm/btt.c | 4 drivers/nvdimm/pmem.c | 4 drivers/nvme/host/apple.c | 2 drivers/nvme/host/core.c | 3 drivers/nvme/host/fc.c | 12 - drivers/nvme/host/multipath.c | 2 drivers/nvme/host/pci.c | 2 drivers/nvme/host/rdma.c | 12 - drivers/nvme/host/tcp.c | 12 - drivers/nvme/target/loop.c | 12 - drivers/s390/block/dasd.c | 2 drivers/s390/block/dasd_genhd.c | 4 drivers/s390/block/dcssblk.c | 8 drivers/s390/block/scm_blk.c | 4 drivers/scsi/scsi_lib.c | 6 drivers/scsi/scsi_sysfs.c | 2 drivers/scsi/sd.c | 4 drivers/scsi/sr.c | 4 drivers/ufs/core/ufshcd.c | 4 include/linux/blk-mq.h | 3 include/linux/blkdev.h | 7 70 files changed, 225 insertions(+), 472 deletions(-)
Christoph Hellwig
maintainerPATCH 1/6 mtip32xx: remove the device_status debugfs file
This file is a huge mess that iterates over all devices and is in the way of fixing the device removal in this driver, so remove it.
--- drivers/block/mtip32xx/mtip32xx.c | 141 +----------------------------- drivers/block/mtip32xx/mtip32xx.h | 4 - 2 files changed, 1 insertion(+), 144 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +1 -140
@@ -94,17 +94,12 @@/* Device instance number, incremented each time a device is probed. */ static int instance; -static LIST_HEAD (online_list); -static LIST_HEAD (removing_list); -static DEFINE_SPINLOCK (dev_lock); -/* * Global variable used to hold the major block device number * allocated in mtip_init(). */ static int mtip_major;static struct dentry *dfs_parent; -static struct dentry *dfs_device_status;static u32 cpu_use[NR_CPUS ];
@@ -2170,106 +2165,6 @@ static const struct attribute_group *mtip_disk_attr_groups[] = { NULL, }; -/* debugsfs entries */ - -static ssize_t show_device_status (struct device_driver *drv,char *buf) -{ -int size =0 ; -struct driver_data *dd, *tmp; -unsigned long flags; -char id_buf[42 ]; -u16 status =0 ; - -spin_lock_irqsave (&dev_lock, flags); - size +=sprintf (&buf[size],"Devices Present:\n" ); -list_for_each_entry_safe (dd, tmp, &online_list, online_list) { -if (dd->pdev) { -if (dd->port && - dd->port->identify && - dd->port->identify_valid) { -strlcpy (id_buf, - (char *) (dd->port->identify +10 ),21 ); - status = *(dd->port->identify +141 ); - }else { -memset (id_buf,0 ,42 ); - status =0 ; - } - -if (dd->port && -test_bit (MTIP_PF_REBUILD_BIT , &dd->port->flags)) { - size +=sprintf (&buf[size], -" device %s %s (ftl rebuild %d %%)\n" , -dev_name (&dd->pdev->dev), - id_buf, - status); - }else { - size +=sprintf (&buf[size], -" device %s %s\n" , -dev_name (&dd->pdev->dev), - id_buf); - } - } - } - - size +=sprintf (&buf[size],"Devices Being Removed:\n" ); -list_for_each_entry_safe (dd, tmp, &removing_list, remove_list) { -if (dd->pdev) { -if (dd->port && - dd->port->identify && - dd->port->identify_valid) { -strlcpy (id_buf, - (char *) (dd->port->identify+10 ),21 ); - status = *(dd->port->identify +141 ); - }else { -memset (id_buf,0 ,42 ); - status =0 ; - } - -if (dd->port && -test_bit (MTIP_PF_REBUILD_BIT , &dd->port->flags)) { - size +=sprintf (&buf[size], -" device %s %s (ftl rebuild %d %%)\n" , -dev_name (&dd->pdev->dev), - id_buf, - status); - }else { - size +=sprintf (&buf[size], -" device %s %s\n" , -dev_name (&dd->pdev->dev), - id_buf); - } - } - } -spin_unlock_irqrestore (&dev_lock, flags); - -return size; -} - -static ssize_t mtip_hw_read_device_status (struct file *f,char __user *ubuf, -size_t len,loff_t *offset) -{ -int size = *offset; -char *buf; -int rv =0 ; - -if (!len || *offset) -return 0 ; - - buf =kzalloc (MTIP_DFS_MAX_BUF_SIZE ,GFP_KERNEL ); -if (!buf) -return -ENOMEM ; - - size +=show_device_status (NULL , buf); - - *offset = size <= len ? size : len; - size =copy_to_user (ubuf, buf, *offset); -if (size) - rv = -EFAULT ; - -kfree (buf); -return rv ? rv : *offset; -} -static ssize_t mtip_hw_read_registers (struct file *f,char __user *ubuf,size_t len,loff_t *offset) {
@@ -2363,13 +2258,6 @@ static ssize_t mtip_hw_read_flags(struct file *f, char __user *ubuf,return rv ? rv : *offset; } -static const struct file_operations mtip_device_status_fops = { - .owner =THIS_MODULE , - .open = simple_open, - .read = mtip_hw_read_device_status, - .llseek = no_llseek, -}; -static const struct file_operations mtip_regs_fops = { .owner =THIS_MODULE , .open = simple_open,
@@ -3905,7 +3793,6 @@ static int mtip_pci_probe(struct pci_dev *pdev,const struct cpumask *node_mask;int cpu, i =0 , j =0 ;int my_node =NUMA_NO_NODE ; -unsigned long flags;/* Allocate memory for this devices private data. */ my_node =pcibus_to_node (pdev->bus);
@@ -3952,9 +3839,6 @@ static int mtip_pci_probe(struct pci_dev *pdev, dd->pdev = pdev; dd->numa_node = my_node; -INIT_LIST_HEAD (&dd->online_list); -INIT_LIST_HEAD (&dd->remove_list); -memset (dd->workq_name,0 ,32 );snprintf (dd->workq_name,31 ,"mtipq%d" , dd->instance);
@@ -4047,11 +3931,6 @@ static int mtip_pci_probe(struct pci_dev *pdev,else rv =0 ;/* device in rebuild state, return 0 from probe */ -/* Add to online list even if in ftl rebuild */ -spin_lock_irqsave (&dev_lock, flags); -list_add (&dd->online_list, &online_list); -spin_unlock_irqrestore (&dev_lock, flags); - goto done; block_initialize_err:
@@ -4085,15 +3964,10 @@ static int mtip_pci_probe(struct pci_dev *pdev,static void mtip_pci_remove (struct pci_dev *pdev) {struct driver_data *dd =pci_get_drvdata (pdev); -unsigned long flags, to; +unsigned long to;set_bit (MTIP_DDF_REMOVAL_BIT , &dd->dd_flag); -spin_lock_irqsave (&dev_lock, flags); -list_del_init (&dd->online_list); -list_add (&dd->remove_list, &removing_list); -spin_unlock_irqrestore (&dev_lock, flags); -mtip_check_surprise_removal (dd);synchronize_irq (dd->pdev->irq);
@@ -4124,10 +3998,6 @@ static void mtip_pci_remove(struct pci_dev *pdev)pci_disable_msi (pdev); -spin_lock_irqsave (&dev_lock, flags); -list_del_init (&dd->remove_list); -spin_unlock_irqrestore (&dev_lock, flags); -kfree (dd);pcim_iounmap_regions (pdev,1 <<MTIP_ABAR );
@@ -4250,15 +4120,6 @@ static int __init mtip_init(void)pr_warn ("Error creating debugfs parent\n" ); dfs_parent =NULL ; } -if (dfs_parent) { - dfs_device_status =debugfs_create_file ("device_status" , -0444 , dfs_parent,NULL , - &mtip_device_status_fops); -if (IS_ERR_OR_NULL (dfs_device_status)) { -pr_err ("Error creating device_status node\n" ); - dfs_device_status =NULL ; - } - }/* Register our PCI operations. */ error =pci_register_driver (&mtip_pci_driver);
drivers/block/mtip32xx/mtip32xx.h +0 -4
@@ -462,10 +462,6 @@ struct driver_data {int isr_binding; -struct list_head online_list;/* linkage for online list */ - -struct list_head remove_list;/* linkage for removing list */ -int unal_qdepth;/* qdepth of unaligned IO queue */ };
Signature · 1 line
2.30.2
Re: [PATCH 1/6] mtip32xx: remove the device_status debugfs file
Quoted 9 lines · Christoph Hellwig
This file is a huge mess that iterates over all devices and is in the way of fixing the device removal in this driver, so remove it.
Signed-off-by Christoph Hellwig <[email protected]>--- drivers/block/mtip32xx/mtip32xx.c | 141 +----------------------------- drivers/block/mtip32xx/mtip32xx.h | 4 - 2 files changed, 1 insertion(+), 144 deletions(-)
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
Christoph Hellwig
maintainerPATCH 2/6 mtip32xx: fix device removal
In reply to Christoph HellwigUse the proper helper to mark a surpise removal, remove the gendisk as soon as possible when removing the device and implement the ->free_disk callback to ensure the private data is alive as long as the gendisk has references.
--- drivers/block/mtip32xx/mtip32xx.c | 157 +++++++++--------------------- drivers/block/mtip32xx/mtip32xx.h | 1 - 2 files changed, 44 insertions(+), 114 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +44 -113
@@ -141,11 +141,8 @@ static bool mtip_check_surprise_removal(struct driver_data *dd)pci_read_config_word (dd->pdev,0x00 , &vendor_id);if (vendor_id ==0xFFFF ) { dd->sr = true; -if (dd->queue) -blk_queue_flag_set (QUEUE_FLAG_DEAD , dd->queue); -else -dev_warn (&dd->pdev->dev, -"%s: dd->queue is NULL\n" , __func__); +if (dd->disk) +blk_mark_disk_dead (dd->disk);return true;/* device removed */ }
@@ -3185,26 +3182,12 @@ static int mtip_block_getgeo(struct block_device *dev,return 0 ; } -static int mtip_block_open (struct block_device *dev,fmode_t mode) +static void mtip_block_free_disk (struct gendisk *disk) { -struct driver_data *dd; - -if (dev && dev->bd_disk) { - dd = (struct driver_data *) dev->bd_disk->private_data; - -if (dd) { -if (test_bit (MTIP_DDF_REMOVAL_BIT , - &dd->dd_flag)) { -return -ENODEV ; - } -return 0 ; - } - } -return -ENODEV ; -} +struct driver_data *dd = disk->private_data; -static void mtip_block_release (struct gendisk *disk,fmode_t mode) -{ +ida_free (&rssd_index_ida, dd->index); +kfree (dd); }/*
@@ -3214,13 +3197,12 @@ static void mtip_block_release(struct gendisk *disk, fmode_t mode)* layer. */ static const struct block_device_operations mtip_block_ops = { - .open = mtip_block_open, - .release = mtip_block_release, .ioctl = mtip_block_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = mtip_block_compat_ioctl, #endif .getgeo = mtip_block_getgeo, + .free_disk = mtip_block_free_disk, .owner =THIS_MODULE };
@@ -3561,72 +3543,6 @@ static int mtip_block_initialize(struct driver_data *dd)return rv; } -static bool mtip_no_dev_cleanup (struct request *rq,void *data,bool reserv) -{ -struct mtip_cmd *cmd =blk_mq_rq_to_pdu (rq); - - cmd->status =BLK_STS_IOERR ; -blk_mq_complete_request (rq); -return true; -} - -/* -* Block layer deinitialization function. -* -* Called by the PCI layer as each P320 device is removed. -* -* @dd Pointer to the driver data structure. -* -* return value -* 0 -*/ -static int mtip_block_remove (struct driver_data *dd) -{ -mtip_hw_debugfs_exit (dd); - -if (dd->mtip_svc_handler) { -set_bit (MTIP_PF_SVC_THD_STOP_BIT , &dd->port->flags); -wake_up_interruptible (&dd->port->svc_wait); -kthread_stop (dd->mtip_svc_handler); - } - -if (!dd->sr) { -/* -* Explicitly wait here for IOs to quiesce, -* as mtip_standby_drive usually won't wait for IOs. -*/ -if (!mtip_quiesce_io (dd->port,MTIP_QUIESCE_IO_TIMEOUT_MS )) -mtip_standby_drive (dd); - } -else -dev_info (&dd->pdev->dev,"device %s surprise removal\n" , - dd->disk->disk_name); - -blk_freeze_queue_start (dd->queue); -blk_mq_quiesce_queue (dd->queue); -blk_mq_tagset_busy_iter (&dd->tags, mtip_no_dev_cleanup, dd); -blk_mq_unquiesce_queue (dd->queue); - -if (dd->disk) { -if (test_bit (MTIP_DDF_INIT_DONE_BIT , &dd->dd_flag)) -del_gendisk (dd->disk); -if (dd->disk->queue) { -blk_cleanup_queue (dd->queue); -blk_mq_free_tag_set (&dd->tags); - dd->queue =NULL ; - } -put_disk (dd->disk); - } - dd->disk =NULL ; - -ida_free (&rssd_index_ida, dd->index); - -/* De-initialize the protocol layer. */ -mtip_hw_exit (dd); - -return 0 ; -} -/* * Function called by the PCI layer when just before the * machine shuts down.
@@ -3643,23 +3559,15 @@ static int mtip_block_shutdown(struct driver_data *dd) {mtip_hw_shutdown (dd); -/* Delete our gendisk structure, and cleanup the blk queue. */ -if (dd->disk) { -dev_info (&dd->pdev->dev, -"Shutting down %s ...\n" , dd->disk->disk_name); +dev_info (&dd->pdev->dev, +"Shutting down %s ...\n" , dd->disk->disk_name); -if (test_bit (MTIP_DDF_INIT_DONE_BIT , &dd->dd_flag)) -del_gendisk (dd->disk); -if (dd->disk->queue) { -blk_cleanup_queue (dd->queue); -blk_mq_free_tag_set (&dd->tags); - } -put_disk (dd->disk); - dd->disk =NULL ; - dd->queue =NULL ; - } +if (test_bit (MTIP_DDF_INIT_DONE_BIT , &dd->dd_flag)) +del_gendisk (dd->disk); -ida_free (&rssd_index_ida, dd->index); +blk_cleanup_queue (dd->queue); +blk_mq_free_tag_set (&dd->tags); +put_disk (dd->disk);return 0 ; }
@@ -3966,8 +3874,6 @@ static void mtip_pci_remove(struct pci_dev *pdev)struct driver_data *dd =pci_get_drvdata (pdev);unsigned long to; -set_bit (MTIP_DDF_REMOVAL_BIT , &dd->dd_flag); -mtip_check_surprise_removal (dd);synchronize_irq (dd->pdev->irq);
@@ -3983,11 +3889,36 @@ static void mtip_pci_remove(struct pci_dev *pdev) "Completion workers still active!\n"); } -blk_mark_disk_dead (dd->disk);set_bit (MTIP_DDF_REMOVE_PENDING_BIT , &dd->dd_flag); -/* Clean up the block layer. */ -mtip_block_remove (dd); +if (test_bit (MTIP_DDF_INIT_DONE_BIT , &dd->dd_flag)) +del_gendisk (dd->disk); + +mtip_hw_debugfs_exit (dd); + +if (dd->mtip_svc_handler) { +set_bit (MTIP_PF_SVC_THD_STOP_BIT , &dd->port->flags); +wake_up_interruptible (&dd->port->svc_wait); +kthread_stop (dd->mtip_svc_handler); + } + +if (!dd->sr) { +/* +* Explicitly wait here for IOs to quiesce, +* as mtip_standby_drive usually won't wait for IOs. +*/ +if (!mtip_quiesce_io (dd->port,MTIP_QUIESCE_IO_TIMEOUT_MS )) +mtip_standby_drive (dd); + } +else +dev_info (&dd->pdev->dev,"device %s surprise removal\n" , + dd->disk->disk_name); + +blk_cleanup_queue (dd->queue); +blk_mq_free_tag_set (&dd->tags); + +/* De-initialize the protocol layer. */ +mtip_hw_exit (dd);if (dd->isr_workq) {destroy_workqueue (dd->isr_workq);
@@ -3998,10 +3929,10 @@ static void mtip_pci_remove(struct pci_dev *pdev)pci_disable_msi (pdev); -kfree (dd); -pcim_iounmap_regions (pdev,1 <<MTIP_ABAR );pci_set_drvdata (pdev,NULL ); + +put_disk (dd->disk); }/*
drivers/block/mtip32xx/mtip32xx.h +0 -1
@@ -149,7 +149,6 @@ enum {MTIP_DDF_RESUME_BIT =6 ,MTIP_DDF_INIT_DONE_BIT =7 ,MTIP_DDF_REBUILD_FAILED_BIT =8 , -MTIP_DDF_REMOVAL_BIT =9 , MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | (1 << MTIP_DDF_SEC_LOCK_BIT) |
Signature · 1 line
2.30.2
Re: [PATCH 2/6] mtip32xx: fix device removal
Quoted 11 lines · Christoph Hellwig
Use the proper helper to mark a surpise removal, remove the gendisk as soon as possible when removing the device and implement the ->free_disk callback to ensure the private data is alive as long as the gendisk has references.
Signed-off-by Christoph Hellwig <[email protected]>--- drivers/block/mtip32xx/mtip32xx.c | 157 +++++++++--------------------- drivers/block/mtip32xx/mtip32xx.h | 1 - 2 files changed, 44 insertions(+), 114 deletions(-)
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
Christoph Hellwig
maintainerPATCH 3/6 block: remove QUEUE_FLAG_DEAD
In reply to Christoph HellwigDisallow setting the blk-mq state on any queue that is already dying as setting the state even then is a bad idea, and remove the now unused QUEUE_FLAG_DEAD flag.
--- block/blk-core.c | 3 --- block/blk-mq-debugfs.c | 8 +++----- include/linux/blkdev.h | 2 -- 3 files changed, 3 insertions(+), 10 deletions(-)
block/blk-core.c +0 -3
@@ -313,9 +313,6 @@ void blk_cleanup_queue(struct request_queue *q)* after draining finished. */ blk_freeze_queue (q); - -blk_queue_flag_set (QUEUE_FLAG_DEAD , q); -blk_sync_queue (q);if (queue_is_mq (q)) {blk_mq_cancel_work_sync (q);
block/blk-mq-debugfs.c +3 -5
@@ -116,7 +116,6 @@ static const char *const blk_queue_flag_name[] = {QUEUE_FLAG_NAME (NOXMERGES ),QUEUE_FLAG_NAME (ADD_RANDOM ),QUEUE_FLAG_NAME (SAME_FORCE ), -QUEUE_FLAG_NAME (DEAD ),QUEUE_FLAG_NAME (INIT_DONE ),QUEUE_FLAG_NAME (STABLE_WRITES ), QUEUE_FLAG_NAME(POLL),
@@ -151,11 +150,10 @@ static ssize_t queue_state_write(void *data, const char __user *buf,char opbuf[16 ] = { }, *op;/* -* The "state" attribute is removed after blk_cleanup_queue() has called -* blk_mq_free_queue(). Return if QUEUE_FLAG_DEAD has been set to avoid -* triggering a use-after-free. +* The "state" attribute is removed when the queue is removed. Don't +* allow setting the state on a dying queue to avoid a use-after-free. */ -if (blk_queue_dead (q)) +if (blk_queue_dying (q))return -ENOENT ;if (count >=sizeof (opbuf)) {
include/linux/blkdev.h +0 -2
@@ -560,7 +560,6 @@ struct request_queue {#define QUEUE_FLAG_NOXMERGES 9/* No extended merges */ #define QUEUE_FLAG_ADD_RANDOM 10/* Contributes to random pool */ #define QUEUE_FLAG_SAME_FORCE 12/* force complete on same CPU */ -#define QUEUE_FLAG_DEAD 13/* queue tear-down finished */ #define QUEUE_FLAG_INIT_DONE 14/* queue is initialized */ #define QUEUE_FLAG_STABLE_WRITES 15/* don't modify blks until WB is done */ #define QUEUE_FLAG_POLL 16/* IO polling enabled if set */
@@ -588,7 +587,6 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);#define blk_queue_stopped (q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)#define blk_queue_dying (q) test_bit(QUEUE_FLAG_DYING, &(q)->queue_flags)#define blk_queue_has_srcu (q) test_bit(QUEUE_FLAG_HAS_SRCU, &(q)->queue_flags) -#define blk_queue_dead (q) test_bit(QUEUE_FLAG_DEAD, &(q)->queue_flags)#define blk_queue_init_done (q) test_bit(QUEUE_FLAG_INIT_DONE, &(q)->queue_flags)#define blk_queue_nomerges (q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)#define blk_queue_noxmerges (q) \
Signature · 1 line
2.30.2
Bart Van Assche
reviewerRe: [PATCH 3/6] block: remove QUEUE_FLAG_DEAD
block/blk-mq-debugfs.c static ssize_t queue_state_write(void *data, const char __user *buf, · line 157
Quoted 13 lines · Christoph Hellwig
block/blk-mq-debugfs.c +3
-4@@ -151,11 +150,10 @@ static ssize_t queue_state_write(void *data, const char __user *buf,char opbuf[16 ] = { }, *op;/* -* The "state" attribute is removed after blk_cleanup_queue() has called -* blk_mq_free_queue(). Return if QUEUE_FLAG_DEAD has been set to avoid -* triggering a use-after-free. +* The "state" attribute is removed when the queue is removed. Don't +* allow setting the state on a dying queue to avoid a use-after-free. */ -if (blk_queue_dead (q)) +if (blk_queue_dying (q))return -ENOENT ;
I'm missing an explanation of why this patch forbids triggering a queue run in the dying state. "dying" means that allocation of new requests will fail. Unless if something fundamentally has changed in the block layer it should still be safe to trigger a queue run in the "dying" state.
Thanks,
Bart.
Christoph Hellwig
maintainerRe: [PATCH 3/6] block: remove QUEUE_FLAG_DEAD
Quoted 8 lines · Bart Van Assche
block/blk-mq-debugfs.c static ssize_t queue_state_write(void *data, const char __user *buf, · line 157
Quoted 3 lines
block/blk-mq-debugfs.c +1
-1-if (blk_queue_dead (q)) +if (blk_queue_dying (q))return -ENOENT ;I'm missing an explanation of why this patch forbids triggering a queue run in the dying state. "dying" means that allocation of new requests will fail. Unless if something fundamentally has changed in the block layer it should still be safe to trigger a queue run in the "dying" state.
It is safe, but not worth having another queue state for given that we can otherwise remove the QUEUE_FLAG_DEAD bit.
Re: [PATCH 3/6] block: remove QUEUE_FLAG_DEAD
In reply to Christoph HellwigQuoted 11 lines · Christoph Hellwig
Disallow setting the blk-mq state on any queue that is already dying as setting the state even then is a bad idea, and remove the now unused
QUEUE_FLAG_DEADflag.Signed-off-by Christoph Hellwig <[email protected]>--- block/blk-core.c | 3 --- block/blk-mq-debugfs.c | 8 +++----- include/linux/blkdev.h | 2 -- 3 files changed, 3 insertions(+), 10 deletions(-)
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
Christoph Hellwig
maintainerPATCH 4/6 block: stop setting the nomerges flags in blk_cleanup_queue
In reply to Christoph HellwigThese flags only apply to file system I/O, and all file system I/O is already drained by del_gendisk and thus can't be in progress when blk_cleanup_queue is called.
--- block/blk-core.c | 3 --- 1 file changed, 3 deletions(-)
block/blk-core.c +0 -3
@@ -304,9 +304,6 @@ void blk_cleanup_queue(struct request_queue *q)blk_queue_flag_set (QUEUE_FLAG_DYING , q);blk_queue_start_drain (q); -blk_queue_flag_set (QUEUE_FLAG_NOMERGES , q); -blk_queue_flag_set (QUEUE_FLAG_NOXMERGES , q); -/* * Drain all requests queued before DYING marking. Set DEAD flag to * prevent that blk_mq_run_hw_queues() accesses the hardware queues
Signature · 1 line
2.30.2
Re: [PATCH 4/6] block: stop setting the nomerges flags in blk_cleanup_queue
Quoted 14 lines · Christoph Hellwig
These flags only apply to file system I/O, and all file system I/O is already drained by
del_gendiskand thus can't be in progress whenblk_cleanup_queueis called.Signed-off-by Christoph Hellwig <[email protected]>--- block/blk-core.c | 3 --- 1 file changed, 3 deletions(-)block/blk-core.c +0
-0
block/blk-core.c void blk_cleanup_queue(struct request_queue *q) · line 309
Quoted 9 lines
block/blk-core.c +0
-3@@ -304,9 +304,6 @@ void blk_cleanup_queue(struct request_queue *q)blk_queue_flag_set (QUEUE_FLAG_DYING , q);blk_queue_start_drain (q); -blk_queue_flag_set (QUEUE_FLAG_NOMERGES , q); -blk_queue_flag_set (QUEUE_FLAG_NOXMERGES , q); -/* * Drain all requests queued before DYING marking. Set DEAD flag to * prevent that blk_mq_run_hw_queues() accesses the hardware queues
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
Christoph Hellwig
maintainerPATCH 5/6 block: simplify disk shutdown
In reply to Christoph HellwigSet the queue dying flag and call blk_mq_exit_queue from del_gendisk for all disks that do not have separately allocated queues, and thus remove the need to call blk_cleanup_queue for them.
Rename blk_cleanup_disk to blk_mq_destroy_queue to make it clear that this function is intended only for separately allocated blk-mq queues.
This saves an extra queue freeze for devices without a separately allocated queue.
--- block/blk-core.c | 37 ------------------------- block/blk-mq.c | 43 +++++++++++++++++++++++++++-- block/blk-sysfs.c | 5 ---- block/blk.h | 3 ++ block/bsg-lib.c | 4 +-- block/genhd.c | 23 ++++++++------- drivers/block/ataflop.c | 1 - drivers/block/loop.c | 1 - drivers/block/mtip32xx/mtip32xx.c | 2 -- drivers/block/rnbd/rnbd-clt.c | 2 +- drivers/block/sx8.c | 4 +-- drivers/block/virtio_blk.c | 1 - drivers/block/z2ram.c | 1 - drivers/cdrom/gdrom.c | 1 - drivers/memstick/core/ms_block.c | 1 - drivers/memstick/core/mspro_block.c | 1 - drivers/mmc/core/block.c | 1 - drivers/mmc/core/queue.c | 1 - drivers/nvme/host/apple.c | 2 +- drivers/nvme/host/core.c | 1 - drivers/nvme/host/fc.c | 12 ++++---- drivers/nvme/host/pci.c | 2 +- drivers/nvme/host/rdma.c | 12 ++++---- drivers/nvme/host/tcp.c | 12 ++++---- drivers/nvme/target/loop.c | 12 ++++---- drivers/s390/block/dasd.c | 2 +- drivers/s390/block/dasd_genhd.c | 4 +-- drivers/scsi/scsi_lib.c | 6 ++-- drivers/scsi/scsi_sysfs.c | 2 +- drivers/scsi/sd.c | 4 +-- drivers/scsi/sr.c | 4 +-- drivers/ufs/core/ufshcd.c | 4 +-- include/linux/blk-mq.h | 3 ++ include/linux/blkdev.h | 4 +-- 34 files changed, 105 insertions(+), 113 deletions(-)
block/blk-core.c +0 -37
@@ -284,43 +284,6 @@ void blk_queue_start_drain(struct request_queue *q)wake_up_all (&q->mq_freeze_wq); } -/** -* blk_cleanup_queue - shutdown a request queue -* @q: request queue to shutdown -* -* Mark @q DYING, drain all pending requests, mark @q DEAD, destroy and -* put it. All future requests will be failed immediately with -ENODEV. -* -* Context: can sleep -*/ -void blk_cleanup_queue (struct request_queue *q) -{ -/* cannot be called from atomic context */ -might_sleep (); - -WARN_ON_ONCE (blk_queue_registered (q)); - -/* mark @q DYING, no new request or merges will be allowed afterwards */ -blk_queue_flag_set (QUEUE_FLAG_DYING , q); -blk_queue_start_drain (q); - -/* -* Drain all requests queued before DYING marking. Set DEAD flag to -* prevent that blk_mq_run_hw_queues() accesses the hardware queues -* after draining finished. -*/ -blk_freeze_queue (q); -blk_sync_queue (q); -if (queue_is_mq (q)) { -blk_mq_cancel_work_sync (q); -blk_mq_exit_queue (q); - } - -/* @q is and will stay empty, shutdown and put */ -blk_put_queue (q); -} -EXPORT_SYMBOL (blk_cleanup_queue); -/** * blk_queue_enter() - try to increase q->q_usage_counter * @q: request queue pointer
block/blk-mq.c +41 -2
67 lines not on this page · raw message
block/blk-sysfs.c +0 -5
@@ -748,11 +748,6 @@ static void blk_free_queue_rcu(struct rcu_head *rcu_head)* decremented with blk_put_queue(). Once the refcount reaches 0 this function * is called. * -* For drivers that have a request_queue on a gendisk and added with -* __device_add_disk() the refcount to request_queue will reach 0 with -* the last put_disk() called by the driver. For drivers which don't use -* __device_add_disk() this happens with blk_cleanup_queue(). -* * Drivers exist which depend on the release of the request_queue to be * synchronous, it should not be deferred. *
block/blk.h +3 -0
@@ -411,6 +411,9 @@ int bdev_resize_partition(struct gendisk *disk, int partno, sector_t start, sector_t length);void blk_drop_partitions (struct gendisk *disk); +struct gendisk *__alloc_disk_node (struct request_queue *q,int node_id, +struct lock_class_key *lkclass); +int bio_add_hw_page (struct request_queue *q,struct bio *bio,struct page *page,unsigned int len,unsigned int offset,unsigned int max_sectors,bool *same_page);
block/bsg-lib.c +2 -2
@@ -324,7 +324,7 @@ void bsg_remove_queue(struct request_queue *q) container_of(q->tag_set, struct bsg_set, tag_set);bsg_unregister_queue (bset->bd); -blk_cleanup_queue (q); +blk_mq_destroy_queue (q);blk_mq_free_tag_set (&bset->tag_set);kfree (bset); }
@@ -399,7 +399,7 @@ struct request_queue *bsg_setup_queue(struct device *dev, const char *name,return q; out_cleanup_queue: -blk_cleanup_queue (q); +blk_mq_destroy_queue (q); out_queue:blk_mq_free_tag_set (set); out_tag_set:
block/genhd.c +13 -10
@@ -617,6 +617,8 @@ void del_gendisk(struct gendisk *disk)* Fail any new I/O. */ set_bit (GD_DEAD , &disk->state); +if (test_bit (GD_OWNS_QUEUE , &disk->state)) +blk_queue_flag_set (QUEUE_FLAG_DYING , q);set_capacity (disk,0 );/*
@@ -663,11 +665,16 @@ void del_gendisk(struct gendisk *disk)blk_mq_unquiesce_queue (q);/* -* Allow using passthrough request again after the queue is torn down. +* If the disk does not own the queue, allow using passthrough requests +* again. Else leave the queue frozen to fail all I/O. */ -blk_queue_flag_clear (QUEUE_FLAG_INIT_DONE , q); -__blk_mq_unfreeze_queue (q, true); - +if (!test_bit (GD_OWNS_QUEUE , &disk->state)) { +blk_queue_flag_clear (QUEUE_FLAG_INIT_DONE , q); +__blk_mq_unfreeze_queue (q, true); + }else { +if (queue_is_mq (q)) +blk_mq_exit_queue (q); + } }EXPORT_SYMBOL (del_gendisk);
@@ -1338,9 +1345,6 @@ struct gendisk *__alloc_disk_node(struct request_queue *q, int node_id, {struct gendisk *disk; -if (!blk_get_queue (q)) -return NULL ; - disk =kzalloc_node (sizeof (struct gendisk ),GFP_KERNEL , node_id);if (!disk) goto out_put_queue;
@@ -1391,7 +1395,6 @@ struct gendisk *__alloc_disk_node(struct request_queue *q, int node_id,blk_put_queue (q);return NULL ; } -EXPORT_SYMBOL (__alloc_disk_node);struct gendisk *__blk_alloc_disk (int node,struct lock_class_key *lkclass) {
@@ -1404,9 +1407,10 @@ struct gendisk *__blk_alloc_disk(int node, struct lock_class_key *lkclass) disk =__alloc_disk_node (q, node, lkclass);if (!disk) { -blk_cleanup_queue (q); +blk_put_queue (q);return NULL ; } +set_bit (GD_OWNS_QUEUE , &disk->state);return disk; }EXPORT_SYMBOL (__blk_alloc_disk);
@@ -1439,7 +1443,6 @@ EXPORT_SYMBOL(put_disk);*/ void blk_cleanup_disk (struct gendisk *disk) { -blk_cleanup_queue (disk->queue);put_disk (disk); }EXPORT_SYMBOL (blk_cleanup_disk);
drivers/block/ataflop.c +0 -1
@@ -2045,7 +2045,6 @@ static void atari_floppy_cleanup(void)if (!unit[i].disk[type])continue ;del_gendisk (unit[i].disk[type]); -blk_cleanup_queue (unit[i].disk[type]->queue);put_disk (unit[i].disk[type]); }blk_mq_free_tag_set (&unit[i].tag_set);
drivers/block/loop.c +0 -1
@@ -2057,7 +2057,6 @@ static void loop_remove(struct loop_device *lo) {/* Make this loop device unreachable from pathname. */ del_gendisk (lo->lo_disk); -blk_cleanup_queue (lo->lo_disk->queue);blk_mq_free_tag_set (&lo->tag_set);mutex_lock (&loop_ctl_mutex);
drivers/block/mtip32xx/mtip32xx.c +0 -2
@@ -3565,7 +3565,6 @@ static int mtip_block_shutdown(struct driver_data *dd)if (test_bit (MTIP_DDF_INIT_DONE_BIT , &dd->dd_flag))del_gendisk (dd->disk); -blk_cleanup_queue (dd->queue);blk_mq_free_tag_set (&dd->tags);put_disk (dd->disk);return 0 ;
@@ -3914,7 +3913,6 @@ static void mtip_pci_remove(struct pci_dev *pdev)dev_info (&dd->pdev->dev,"device %s surprise removal\n" , dd->disk->disk_name); -blk_cleanup_queue (dd->queue);blk_mq_free_tag_set (&dd->tags);/* De-initialize the protocol layer. */
drivers/block/rnbd/rnbd-clt.c +1 -1
@@ -1755,7 +1755,7 @@ static void rnbd_destroy_sessions(void)list_for_each_entry_safe (dev, tn, &sess->devs_list, list) {/* * Here unmap happens in parallel for only one reason: -* blk_cleanup_queue() takes around half a second, so +* del_gendisk() takes around half a second, so * on huge amount of devices the whole module unload * procedure takes minutes. */
drivers/block/sx8.c +2 -2
@@ -1536,7 +1536,7 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)clear_bit (0 , &carm_major_alloc); else if (host->major == 161) clear_bit(1, &carm_major_alloc); -blk_cleanup_queue (host->oob_q); +blk_mq_destroy_queue (host->oob_q);blk_mq_free_tag_set (&host->tag_set); err_out_dma_free:dma_free_coherent (&pdev->dev,CARM_SHM_SIZE , host->shm, host->shm_dma);
@@ -1570,7 +1570,7 @@ static void carm_remove_one (struct pci_dev *pdev)clear_bit (0 , &carm_major_alloc); else if (host->major == 161) clear_bit(1, &carm_major_alloc); -blk_cleanup_queue (host->oob_q); +blk_mq_destroy_queue (host->oob_q);blk_mq_free_tag_set (&host->tag_set);dma_free_coherent (&pdev->dev,CARM_SHM_SIZE , host->shm, host->shm_dma);iounmap (host->mmio);
drivers/block/virtio_blk.c +0 -1
@@ -1111,7 +1111,6 @@ static void virtblk_remove(struct virtio_device *vdev)flush_work (&vblk->config_work);del_gendisk (vblk->disk); -blk_cleanup_queue (vblk->disk->queue);blk_mq_free_tag_set (&vblk->tag_set);mutex_lock (&vblk->vdev_mutex);
drivers/block/z2ram.c +0 -1
@@ -384,7 +384,6 @@ static void __exit z2_exit(void)for (i =0 ; i <Z2MINOR_COUNT ; i++) {del_gendisk (z2ram_gendisk[i]); -blk_cleanup_queue (z2ram_gendisk[i]->queue);put_disk (z2ram_gendisk[i]); }blk_mq_free_tag_set (&tag_set);
drivers/cdrom/gdrom.c +0 -1
@@ -831,7 +831,6 @@ static int probe_gdrom(struct platform_device *devptr)static int remove_gdrom (struct platform_device *devptr) { -blk_cleanup_queue (gd.gdrom_rq);blk_mq_free_tag_set (&gd.tag_set);free_irq (HW_EVENT_GDROM_CMD , &gd);free_irq (HW_EVENT_GDROM_DMA , &gd);
drivers/memstick/core/ms_block.c +0 -1
@@ -2187,7 +2187,6 @@ static void msb_remove(struct memstick_dev *card)/* Remove the disk */ del_gendisk (msb->disk); -blk_cleanup_queue (msb->queue);blk_mq_free_tag_set (&msb->tag_set); msb->queue =NULL ;
drivers/memstick/core/mspro_block.c +0 -1
@@ -1294,7 +1294,6 @@ static void mspro_block_remove(struct memstick_dev *card)del_gendisk (msb->disk);dev_dbg (&card->dev,"mspro block remove\n" ); -blk_cleanup_queue (msb->queue);blk_mq_free_tag_set (&msb->tag_set); msb->queue =NULL ;
drivers/mmc/core/block.c +0 -1
@@ -2509,7 +2509,6 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,return md; err_cleanup_queue: -blk_cleanup_queue (md->disk->queue);blk_mq_free_tag_set (&md->queue.tag_set); err_kfree:kfree (md);
drivers/mmc/core/queue.c +0 -1
@@ -494,7 +494,6 @@ void mmc_cleanup_queue(struct mmc_queue *mq)if (blk_queue_quiesced (q))blk_mq_unquiesce_queue (q); -blk_cleanup_queue (q);blk_mq_free_tag_set (&mq->tag_set);/*
drivers/nvme/host/apple.c +1 -1
@@ -1502,7 +1502,7 @@ static int apple_nvme_probe(struct platform_device *pdev)if (!blk_get_queue (anv->ctrl.admin_q)) {nvme_start_admin_queue (&anv->ctrl); -blk_cleanup_queue (anv->ctrl.admin_q); +blk_mq_destroy_queue (anv->ctrl.admin_q); anv->ctrl.admin_q =NULL ; ret = -ENODEV ; goto put_dev;
drivers/nvme/host/core.c +0 -1
@@ -4089,7 +4089,6 @@ static void nvme_ns_remove(struct nvme_ns *ns)if (!nvme_ns_head_multipath (ns->head))nvme_cdev_del (&ns->cdev, &ns->cdev_device);del_gendisk (ns->disk); -blk_cleanup_queue (ns->queue);down_write (&ns->ctrl->namespaces_rwsem);list_del_init (&ns->list);
drivers/nvme/host/fc.c +6 -6
@@ -2392,7 +2392,7 @@ nvme_fc_ctrl_free(struct kref *ref)unsigned long flags;if (ctrl->ctrl.tagset) { -blk_cleanup_queue (ctrl->ctrl.connect_q); +blk_mq_destroy_queue (ctrl->ctrl.connect_q);blk_mq_free_tag_set (&ctrl->tag_set); }
@@ -2402,8 +2402,8 @@ nvme_fc_ctrl_free(struct kref *ref)spin_unlock_irqrestore (&ctrl->rport->lock, flags);nvme_start_admin_queue (&ctrl->ctrl); -blk_cleanup_queue (ctrl->ctrl.admin_q); -blk_cleanup_queue (ctrl->ctrl.fabrics_q); +blk_mq_destroy_queue (ctrl->ctrl.admin_q); +blk_mq_destroy_queue (ctrl->ctrl.fabrics_q);blk_mq_free_tag_set (&ctrl->admin_tag_set);kfree (ctrl->queues);
@@ -2953,7 +2953,7 @@ nvme_fc_create_io_queues(struct nvme_fc_ctrl *ctrl) out_delete_hw_queues:nvme_fc_delete_hw_io_queues (ctrl); out_cleanup_blk_queue: -blk_cleanup_queue (ctrl->ctrl.connect_q); +blk_mq_destroy_queue (ctrl->ctrl.connect_q); out_free_tag_set:blk_mq_free_tag_set (&ctrl->tag_set);nvme_fc_free_io_queues (ctrl);
@@ -3642,9 +3642,9 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,return ERR_PTR (-EIO ); out_cleanup_admin_q: -blk_cleanup_queue (ctrl->ctrl.admin_q); +blk_mq_destroy_queue (ctrl->ctrl.admin_q); out_cleanup_fabrics_q: -blk_cleanup_queue (ctrl->ctrl.fabrics_q); +blk_mq_destroy_queue (ctrl->ctrl.fabrics_q); out_free_admin_tag_set:blk_mq_free_tag_set (&ctrl->admin_tag_set); out_free_queues:
drivers/nvme/host/pci.c +1 -1
@@ -1760,7 +1760,7 @@ static void nvme_dev_remove_admin(struct nvme_dev *dev)* queue to flush these to completion. */ nvme_start_admin_queue (&dev->ctrl); -blk_cleanup_queue (dev->ctrl.admin_q); +blk_mq_destroy_queue (dev->ctrl.admin_q);blk_mq_free_tag_set (&dev->admin_tagset); } }
drivers/nvme/host/rdma.c +6 -6
@@ -840,8 +840,8 @@ static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl, bool remove) {if (remove) { -blk_cleanup_queue (ctrl->ctrl.admin_q); -blk_cleanup_queue (ctrl->ctrl.fabrics_q); +blk_mq_destroy_queue (ctrl->ctrl.admin_q); +blk_mq_destroy_queue (ctrl->ctrl.fabrics_q);blk_mq_free_tag_set (ctrl->ctrl.admin_tagset); }if (ctrl->async_event_sqe.data) {
@@ -935,10 +935,10 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl,nvme_cancel_admin_tagset (&ctrl->ctrl); out_cleanup_queue:if (new) -blk_cleanup_queue (ctrl->ctrl.admin_q); +blk_mq_destroy_queue (ctrl->ctrl.admin_q); out_cleanup_fabrics_q:if (new) -blk_cleanup_queue (ctrl->ctrl.fabrics_q); +blk_mq_destroy_queue (ctrl->ctrl.fabrics_q); out_free_tagset:if (new)blk_mq_free_tag_set (ctrl->ctrl.admin_tagset);
@@ -957,7 +957,7 @@ static void nvme_rdma_destroy_io_queues(struct nvme_rdma_ctrl *ctrl, bool remove) {if (remove) { -blk_cleanup_queue (ctrl->ctrl.connect_q); +blk_mq_destroy_queue (ctrl->ctrl.connect_q);blk_mq_free_tag_set (ctrl->ctrl.tagset); }nvme_rdma_free_io_queues (ctrl);
@@ -1012,7 +1012,7 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new) out_cleanup_connect_q:nvme_cancel_tagset (&ctrl->ctrl);if (new) -blk_cleanup_queue (ctrl->ctrl.connect_q); +blk_mq_destroy_queue (ctrl->ctrl.connect_q); out_free_tag_set:if (new)blk_mq_free_tag_set (ctrl->ctrl.tagset);
drivers/nvme/host/tcp.c +6 -6
@@ -1885,7 +1885,7 @@ static void nvme_tcp_destroy_io_queues(struct nvme_ctrl *ctrl, bool remove) {nvme_tcp_stop_io_queues (ctrl);if (remove) { -blk_cleanup_queue (ctrl->connect_q); +blk_mq_destroy_queue (ctrl->connect_q);blk_mq_free_tag_set (ctrl->tagset); }nvme_tcp_free_io_queues (ctrl);
@@ -1940,7 +1940,7 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new) out_cleanup_connect_q:nvme_cancel_tagset (ctrl);if (new) -blk_cleanup_queue (ctrl->connect_q); +blk_mq_destroy_queue (ctrl->connect_q); out_free_tag_set:if (new)blk_mq_free_tag_set (ctrl->tagset);
@@ -1953,8 +1953,8 @@ static void nvme_tcp_destroy_admin_queue(struct nvme_ctrl *ctrl, bool remove) {nvme_tcp_stop_queue (ctrl,0 );if (remove) { -blk_cleanup_queue (ctrl->admin_q); -blk_cleanup_queue (ctrl->fabrics_q); +blk_mq_destroy_queue (ctrl->admin_q); +blk_mq_destroy_queue (ctrl->fabrics_q);blk_mq_free_tag_set (ctrl->admin_tagset); }nvme_tcp_free_admin_queue (ctrl);
@@ -2012,10 +2012,10 @@ static int nvme_tcp_configure_admin_queue(struct nvme_ctrl *ctrl, bool new)nvme_cancel_admin_tagset (ctrl); out_cleanup_queue:if (new) -blk_cleanup_queue (ctrl->admin_q); +blk_mq_destroy_queue (ctrl->admin_q); out_cleanup_fabrics_q:if (new) -blk_cleanup_queue (ctrl->fabrics_q); +blk_mq_destroy_queue (ctrl->fabrics_q); out_free_tagset:if (new)blk_mq_free_tag_set (ctrl->admin_tagset);
drivers/nvme/target/loop.c +6 -6
@@ -266,8 +266,8 @@ static void nvme_loop_destroy_admin_queue(struct nvme_loop_ctrl *ctrl)if (!test_and_clear_bit (NVME_LOOP_Q_LIVE , &ctrl->queues[0 ].flags))return ;nvmet_sq_destroy (&ctrl->queues[0 ].nvme_sq); -blk_cleanup_queue (ctrl->ctrl.admin_q); -blk_cleanup_queue (ctrl->ctrl.fabrics_q); +blk_mq_destroy_queue (ctrl->ctrl.admin_q); +blk_mq_destroy_queue (ctrl->ctrl.fabrics_q);blk_mq_free_tag_set (&ctrl->admin_tag_set); }
@@ -283,7 +283,7 @@ static void nvme_loop_free_ctrl(struct nvme_ctrl *nctrl)mutex_unlock (&nvme_loop_ctrl_mutex);if (nctrl->tagset) { -blk_cleanup_queue (ctrl->ctrl.connect_q); +blk_mq_destroy_queue (ctrl->ctrl.connect_q);blk_mq_free_tag_set (&ctrl->tag_set); }kfree (ctrl->queues);
@@ -410,9 +410,9 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl) out_cleanup_queue:clear_bit (NVME_LOOP_Q_LIVE , &ctrl->queues[0 ].flags); -blk_cleanup_queue (ctrl->ctrl.admin_q); +blk_mq_destroy_queue (ctrl->ctrl.admin_q); out_cleanup_fabrics_q: -blk_cleanup_queue (ctrl->ctrl.fabrics_q); +blk_mq_destroy_queue (ctrl->ctrl.fabrics_q); out_free_tagset:blk_mq_free_tag_set (&ctrl->admin_tag_set); out_free_sq:
@@ -554,7 +554,7 @@ static int nvme_loop_create_io_queues(struct nvme_loop_ctrl *ctrl)return 0 ; out_cleanup_connect_q: -blk_cleanup_queue (ctrl->ctrl.connect_q); +blk_mq_destroy_queue (ctrl->ctrl.connect_q); out_free_tagset:blk_mq_free_tag_set (&ctrl->tag_set); out_destroy_queues:
drivers/s390/block/dasd.c +1 -1
@@ -3280,7 +3280,7 @@ static int dasd_alloc_queue(struct dasd_block *block)static void dasd_free_queue (struct dasd_block *block) {if (block->request_queue) { -blk_cleanup_queue (block->request_queue); +blk_mq_destroy_queue (block->request_queue);blk_mq_free_tag_set (&block->tag_set); block->request_queue =NULL ; }
drivers/s390/block/dasd_genhd.c +2 -2
@@ -41,8 +41,8 @@ int dasd_gendisk_alloc(struct dasd_block *block)if (base->devindex >=DASD_PER_MAJOR )return -EBUSY ; - gdp =__alloc_disk_node (block->request_queue,NUMA_NO_NODE , - &dasd_bio_compl_lkclass); + gdp =blk_mq_alloc_disk_for_queue (block->request_queue, + &dasd_bio_compl_lkclass);if (!gdp)return -ENOMEM ;
drivers/scsi/scsi_lib.c +3 -3
@@ -163,7 +163,7 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, bool unbusy)* Requeue this command. It will go before all other commands * that are already in the queue. Schedule requeue work under * lock such that the kblockd_schedule_work() call happens -* before blk_cleanup_queue() finishes. +* before blk_mq_destroy_queue() finishes. */ cmd->result =0 ;
@@ -424,9 +424,9 @@ static void scsi_starved_list_run(struct Scsi_Host *shost)* it and the queue. Mitigate by taking a reference to the * queue and never touching the sdev again after we drop the * host lock. Note: if __scsi_remove_device() invokes -* blk_cleanup_queue() before the queue is run from this +* blk_mq_destroy_queue() before the queue is run from this * function then blk_run_queue() will return immediately since -* blk_cleanup_queue() marks the queue with QUEUE_FLAG_DYING. +* blk_mq_destroy_queue() marks the queue with QUEUE_FLAG_DYING. */ slq = sdev->request_queue;if (!blk_get_queue (slq))
drivers/scsi/scsi_sysfs.c +1 -1
@@ -1475,7 +1475,7 @@ void __scsi_remove_device(struct scsi_device *sdev)scsi_device_set_state (sdev,SDEV_DEL );mutex_unlock (&sdev->state_mutex); -blk_cleanup_queue (sdev->request_queue); +blk_mq_destroy_queue (sdev->request_queue);cancel_work_sync (&sdev->requeue_work);if (sdev->host->hostt->slave_destroy)
drivers/scsi/sd.c +2 -2
@@ -3440,8 +3440,8 @@ static int sd_probe(struct device *dev)if (!sdkp) goto out; - gd =__alloc_disk_node (sdp->request_queue,NUMA_NO_NODE , - &sd_bio_compl_lkclass); + gd =blk_mq_alloc_disk_for_queue (sdp->request_queue, + &sd_bio_compl_lkclass);if (!gd) goto out_free;
drivers/scsi/sr.c +2 -2
@@ -624,8 +624,8 @@ static int sr_probe(struct device *dev)if (!cd) goto fail; - disk =__alloc_disk_node (sdev->request_queue,NUMA_NO_NODE , - &sr_bio_compl_lkclass); + disk =blk_mq_alloc_disk_for_queue (sdev->request_queue, + &sr_bio_compl_lkclass);if (!disk) goto fail_free;mutex_init (&cd->lock);
drivers/ufs/core/ufshcd.c +2 -2
@@ -9467,7 +9467,7 @@ void ufshcd_remove(struct ufs_hba *hba)ufs_bsg_remove (hba);ufshpb_remove (hba);ufs_sysfs_remove_nodes (hba->dev); -blk_cleanup_queue (hba->tmf_queue); +blk_mq_destroy_queue (hba->tmf_queue);blk_mq_free_tag_set (&hba->tmf_tag_set);scsi_remove_host (hba->host);/* disable interrupts */
@@ -9763,7 +9763,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)return 0 ; free_tmf_queue: -blk_cleanup_queue (hba->tmf_queue); +blk_mq_destroy_queue (hba->tmf_queue); free_tmf_tag_set:blk_mq_free_tag_set (&hba->tmf_tag_set); out_remove_scsi_host:
include/linux/blk-mq.h +3 -0
@@ -686,10 +686,13 @@ struct gendisk *__blk_mq_alloc_disk(struct blk_mq_tag_set *set, void *queuedata, \__blk_mq_alloc_disk (set, queuedata, &__key); \ }) +struct gendisk *blk_mq_alloc_disk_for_queue (struct request_queue *q, +struct lock_class_key *lkclass);struct request_queue *blk_mq_init_queue (struct blk_mq_tag_set *);int blk_mq_init_allocated_queue (struct blk_mq_tag_set *set,struct request_queue *q);void blk_mq_unregister_dev (struct device *,struct request_queue *); +void blk_mq_destroy_queue (struct request_queue *);int blk_mq_alloc_tag_set (struct blk_mq_tag_set *set); int blk_mq_alloc_sq_tag_set(struct blk_mq_tag_set *set,
include/linux/blkdev.h +1 -3
@@ -148,6 +148,7 @@ struct gendisk {#define GD_NATIVE_CAPACITY 3#define GD_ADDED 4#define GD_SUPPRESS_PART_SCAN 5 +#define GD_OWNS_QUEUE 6struct mutex open_mutex;/* open/close mutex */ unsigned open_partitions;/* number of open partitions */
@@ -811,8 +812,6 @@ static inline u64 sb_bdev_nr_blocks(struct super_block *sb)int bdev_disk_changed (struct gendisk *disk,bool invalidate); -struct gendisk *__alloc_disk_node (struct request_queue *q,int node_id, -struct lock_class_key *lkclass);void put_disk (struct gendisk *disk);struct gendisk *__blk_alloc_disk (int node,struct lock_class_key *lkclass);
@@ -954,7 +953,6 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q,/* * Access functions for manipulating queue properties */ -extern void blk_cleanup_queue (struct request_queue *);void blk_queue_bounce_limit (struct request_queue *q,enum blk_bounce limit);extern void blk_queue_max_hw_sectors (struct request_queue *,unsigned int );extern void blk_queue_chunk_sectors (struct request_queue *,unsigned int );
Signature · 1 line
2.30.2
Re: [PATCH 5/6] block: simplify disk shutdown
Quoted 39 lines · Christoph Hellwig
Set the queue dying flag and call
blk_mq_exit_queuefromdel_gendiskfor all disks that do not have separately allocated queues, and thus remove the need to callblk_cleanup_queuefor them.Rename
blk_cleanup_disktoblk_mq_destroy_queueto make it clear that this function is intended only for separately allocated blk-mq queues.This saves an extra queue freeze for devices without a separately allocated queue.
Signed-off-by Christoph Hellwig <[email protected]>--- block/blk-core.c | 37 ------------------------- block/blk-mq.c | 43 +++++++++++++++++++++++++++-- block/blk-sysfs.c | 5 ---- block/blk.h | 3 ++ block/bsg-lib.c | 4 +-- block/genhd.c | 23 ++++++++------- drivers/block/ataflop.c | 1 - drivers/block/loop.c | 1 - drivers/block/mtip32xx/mtip32xx.c | 2 -- drivers/block/rnbd/rnbd-clt.c | 2 +- drivers/block/sx8.c | 4 +-- drivers/block/virtio_blk.c | 1 - drivers/block/z2ram.c | 1 - drivers/cdrom/gdrom.c | 1 - drivers/memstick/core/ms_block.c | 1 - drivers/memstick/core/mspro_block.c | 1 - drivers/mmc/core/block.c | 1 - drivers/mmc/core/queue.c | 1 - drivers/nvme/host/apple.c | 2 +- drivers/nvme/host/core.c | 1 - drivers/nvme/host/fc.c | 12 ++++---- drivers/nvme/host/pci.c | 2 +- drivers/nvme/host/rdma.c | 12 ++++---- drivers/nvme/host/tcp.c | 12 ++++---- drivers/nvme/target/loop.c | 12 ++++---- drivers/s390/block/dasd.c | 2 +- drivers/s390/block/dasd_genhd.c | 4 +--
Quoted 9 lines
drivers/scsi/scsi_lib.c | 6 ++-- drivers/scsi/scsi_sysfs.c | 2 +- drivers/scsi/sd.c | 4 +-- drivers/scsi/sr.c | 4 +-- drivers/ufs/core/ufshcd.c | 4 +-- include/linux/blk-mq.h | 3 ++ include/linux/blkdev.h | 4 +-- 34 files changed, 105 insertions(+), 113 deletions(-)
(This will come back to haunt me once I have to do a backport ...) (But anyway.)
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
Christoph Hellwig
maintainerPATCH 6/6 block: remove blk_cleanup_disk
In reply to Christoph Hellwigblk_cleanup_disk is nothing but a trivial wrapper for put_disk now, so remove it.
--- arch/m68k/emu/nfblock.c | 4 ++-- arch/um/drivers/ubd_kern.c | 4 ++-- arch/xtensa/platforms/iss/simdisk.c | 4 ++-- block/genhd.c | 15 --------------- drivers/block/amiflop.c | 2 +- drivers/block/aoe/aoeblk.c | 2 +- drivers/block/aoe/aoedev.c | 2 +- drivers/block/ataflop.c | 4 ++-- drivers/block/brd.c | 4 ++-- drivers/block/drbd/drbd_main.c | 4 ++-- drivers/block/floppy.c | 6 +++--- drivers/block/loop.c | 2 +- drivers/block/mtip32xx/mtip32xx.c | 2 +- drivers/block/n64cart.c | 2 +- drivers/block/nbd.c | 4 ++-- drivers/block/null_blk/main.c | 4 ++-- drivers/block/paride/pcd.c | 4 ++-- drivers/block/paride/pd.c | 4 ++-- drivers/block/paride/pf.c | 4 ++-- drivers/block/pktcdvd.c | 4 ++-- drivers/block/ps3disk.c | 4 ++-- drivers/block/ps3vram.c | 4 ++-- drivers/block/rbd.c | 2 +- drivers/block/rnbd/rnbd-clt.c | 4 ++-- drivers/block/sunvdc.c | 4 ++-- drivers/block/swim.c | 2 +- drivers/block/swim3.c | 2 +- drivers/block/sx8.c | 2 +- drivers/block/virtio_blk.c | 2 +- drivers/block/xen-blkfront.c | 4 ++-- drivers/block/z2ram.c | 2 +- drivers/block/zram/zram_drv.c | 4 ++-- drivers/cdrom/gdrom.c | 2 +- drivers/md/bcache/super.c | 2 +- drivers/md/dm.c | 2 +- drivers/md/md.c | 4 ++-- drivers/memstick/core/ms_block.c | 2 +- drivers/memstick/core/mspro_block.c | 2 +- drivers/mtd/mtd_blkdevs.c | 4 ++-- drivers/mtd/ubi/block.c | 4 ++-- drivers/nvdimm/btt.c | 4 ++-- drivers/nvdimm/pmem.c | 4 ++-- drivers/nvme/host/core.c | 2 +- drivers/nvme/host/multipath.c | 2 +- drivers/s390/block/dcssblk.c | 8 ++++---- drivers/s390/block/scm_blk.c | 4 ++-- include/linux/blkdev.h | 1 - 47 files changed, 74 insertions(+), 90 deletions(-)
arch/m68k/emu/nfblock.c +2 -2
@@ -138,7 +138,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)return 0 ; out_cleanup_disk: -blk_cleanup_disk (dev->disk); +put_disk (dev->disk); free_dev:kfree (dev); out:
@@ -180,7 +180,7 @@ static void __exit nfhd_exit(void)list_for_each_entry_safe (dev, next, &nfhd_list, list) {list_del (&dev->list);del_gendisk (dev->disk); -blk_cleanup_disk (dev->disk); +put_disk (dev->disk);kfree (dev); }unregister_blkdev (major_num,"nfhd" );
arch/um/drivers/ubd_kern.c +2 -2
@@ -925,7 +925,7 @@ static int ubd_add(int n, char **error_out)return 0 ; out_cleanup_disk: -blk_cleanup_disk (disk); +put_disk (disk); out_cleanup_tags:blk_mq_free_tag_set (&ubd_dev->tag_set); out:
@@ -1032,7 +1032,7 @@ static int ubd_remove(int n, char **error_out) ubd_gendisk[n] =NULL ;if (disk !=NULL ){del_gendisk (disk); -blk_cleanup_disk (disk); +put_disk (disk); } err =0 ;
arch/xtensa/platforms/iss/simdisk.c +2 -2
@@ -290,7 +290,7 @@ static int __init simdisk_setup(struct simdisk *dev, int which,return 0 ; out_cleanup_disk: -blk_cleanup_disk (dev->gd); +put_disk (dev->gd); out:return err; }
@@ -344,7 +344,7 @@ static void simdisk_teardown(struct simdisk *dev, int which,simdisk_detach (dev);if (dev->gd) {del_gendisk (dev->gd); -blk_cleanup_disk (dev->gd); +put_disk (dev->gd); }remove_proc_entry (tmp, procdir); }
block/genhd.c +0 -15
@@ -1432,21 +1432,6 @@ void put_disk(struct gendisk *disk) }EXPORT_SYMBOL (put_disk); -/** -* blk_cleanup_disk - shutdown a gendisk allocated by blk_alloc_disk -* @disk: gendisk to shutdown -* -* Mark the queue hanging off @disk DYING, drain all pending requests, then mark -* the queue DEAD, destroy and put it and the gendisk structure. -* -* Context: can sleep -*/ -void blk_cleanup_disk (struct gendisk *disk) -{ -put_disk (disk); -} -EXPORT_SYMBOL (blk_cleanup_disk); -static void set_disk_ro_uevent (struct gendisk *gd,int ro) {char event[] ="DISK_RO=1" ;
drivers/block/amiflop.c +1 -1
@@ -1802,7 +1802,7 @@ static int fd_alloc_disk(int drive, int system) unit[drive].gendisk[system] = disk; err =add_disk (disk);if (err) -blk_cleanup_disk (disk); +put_disk (disk);return err; }
drivers/block/aoe/aoeblk.c +1 -1
@@ -427,7 +427,7 @@ aoeblk_gdalloc(void *vp)return ; out_disk_cleanup: -blk_cleanup_disk (gd); +put_disk (gd); err_tagset:blk_mq_free_tag_set (set); err_mempool:
drivers/block/aoe/aoedev.c +1 -1
@@ -277,7 +277,7 @@ freedev(struct aoedev *d)if (d->gd) {aoedisk_rm_debugfs (d);del_gendisk (d->gd); -blk_cleanup_disk (d->gd); +put_disk (d->gd);blk_mq_free_tag_set (&d->tag_set); } t = d->targets;
drivers/block/ataflop.c +2 -2
@@ -2031,7 +2031,7 @@ static void ataflop_probe(dev_t dev)return ; cleanup_disk: -blk_cleanup_disk (unit[drive].disk[type]); +put_disk (unit[drive].disk[type]); unit[drive].disk[type] =NULL ; }
@@ -2063,7 +2063,7 @@ static void atari_cleanup_floppy_disk(struct atari_floppy_struct *fs)continue ;if (fs->registered[type])del_gendisk (fs->disk[type]); -blk_cleanup_disk (fs->disk[type]); +put_disk (fs->disk[type]); }blk_mq_free_tag_set (&fs->tag_set); }
drivers/block/brd.c +2 -2
@@ -419,7 +419,7 @@ static int brd_alloc(int i)return 0 ; out_cleanup_disk: -blk_cleanup_disk (disk); +put_disk (disk); out_free_dev:list_del (&brd->brd_list);kfree (brd);
@@ -439,7 +439,7 @@ static void brd_cleanup(void)list_for_each_entry_safe (brd, next, &brd_devices, brd_list) {del_gendisk (brd->brd_disk); -blk_cleanup_disk (brd->brd_disk); +put_disk (brd->brd_disk);brd_free_pages (brd);list_del (&brd->brd_list);kfree (brd);
drivers/block/drbd/drbd_main.c +2 -2
@@ -2207,7 +2207,7 @@ void drbd_destroy_device(struct kref *kref)if (device->bitmap)/* should no longer be there. */ drbd_bm_cleanup (device);__free_page (device->md_io.page); -blk_cleanup_disk (device->vdisk); +put_disk (device->vdisk);kfree (device->rs_plan_s);/* not for_each_connection(connection, resource):
@@ -2807,7 +2807,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig out_no_bitmap:__free_page (device->md_io.page); out_no_io_page: -blk_cleanup_disk (disk); +put_disk (disk); out_no_disk:kref_put (&resource->kref, drbd_destroy_resource);kfree (device);
drivers/block/floppy.c +3 -3
@@ -4557,7 +4557,7 @@ static void floppy_probe(dev_t dev)return ; cleanup_disk: -blk_cleanup_disk (disks[drive][type]); +put_disk (disks[drive][type]); disks[drive][type] =NULL ;mutex_unlock (&floppy_probe_lock); }
@@ -4753,7 +4753,7 @@ static int __init do_floppy_init(void)if (!disks[drive][0 ])break ;del_timer_sync (&motor_off_timer[drive]); -blk_cleanup_disk (disks[drive][0 ]); +put_disk (disks[drive][0 ]);blk_mq_free_tag_set (&tag_sets[drive]); }return err;
@@ -4985,7 +4985,7 @@ static void __exit floppy_module_exit(void) }for (i =0 ; i <ARRAY_SIZE (floppy_type); i++) {if (disks[drive][i]) -blk_cleanup_disk (disks[drive][i]); +put_disk (disks[drive][i]); }blk_mq_free_tag_set (&tag_sets[drive]); }
drivers/block/loop.c +1 -1
@@ -2040,7 +2040,7 @@ static int loop_add(int i)return i; out_cleanup_disk: -blk_cleanup_disk (disk); +put_disk (disk); out_cleanup_tags:blk_mq_free_tag_set (&lo->tag_set); out_free_idr:
drivers/block/mtip32xx/mtip32xx.c +1 -1
@@ -3534,7 +3534,7 @@ static int mtip_block_initialize(struct driver_data *dd) disk_index_error:ida_free (&rssd_index_ida, index); ida_get_error: -blk_cleanup_disk (dd->disk); +put_disk (dd->disk); block_queue_alloc_init_error:blk_mq_free_tag_set (&dd->tags); block_queue_alloc_tag_error:
drivers/block/n64cart.c +1 -1
@@ -157,7 +157,7 @@ static int __init n64cart_probe(struct platform_device *pdev)return 0 ; out_cleanup_disk: -blk_cleanup_disk (disk); +put_disk (disk); out:return err; }
drivers/block/nbd.c +2 -2
@@ -250,7 +250,7 @@ static void nbd_dev_remove(struct nbd_device *nbd)struct gendisk *disk = nbd->disk;del_gendisk (disk); -blk_cleanup_disk (disk); +put_disk (disk);blk_mq_free_tag_set (&nbd->tag_set);/*
@@ -1833,7 +1833,7 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs) out_free_work:destroy_workqueue (nbd->recv_workq); out_err_disk: -blk_cleanup_disk (disk); +put_disk (disk); out_free_idr:mutex_lock (&nbd_index_mutex);idr_remove (&nbd_index_idr, index);
drivers/block/null_blk/main.c +2 -2
@@ -1737,7 +1737,7 @@ static void null_del_dev(struct nullb *nullb)null_restart_queue_async (nullb); } -blk_cleanup_disk (nullb->disk); +put_disk (nullb->disk);if (dev->queue_mode ==NULL_Q_MQ && nullb->tag_set == &nullb->__tag_set)blk_mq_free_tag_set (nullb->tag_set);
@@ -2082,7 +2082,7 @@ static int null_add_dev(struct nullb_device *dev) out_cleanup_zone:null_free_zoned_dev (dev); out_cleanup_disk: -blk_cleanup_disk (nullb->disk); +put_disk (nullb->disk); out_cleanup_tags:if (dev->queue_mode ==NULL_Q_MQ && nullb->tag_set == &nullb->__tag_set)blk_mq_free_tag_set (nullb->tag_set);
drivers/block/paride/pcd.c +2 -2
@@ -956,7 +956,7 @@ static int pcd_init_unit(struct pcd_unit *cd, bool autoprobe, int port, out_pi_release:pi_release (cd->pi); out_free_disk: -blk_cleanup_disk (cd->disk); +put_disk (cd->disk); out_free_tag_set:blk_mq_free_tag_set (&cd->tag_set);return ret;
@@ -1029,7 +1029,7 @@ static void __exit pcd_exit(void)unregister_cdrom (&cd->info);del_gendisk (cd->disk);pi_release (cd->pi); -blk_cleanup_disk (cd->disk); +put_disk (cd->disk);blk_mq_free_tag_set (&cd->tag_set); }
drivers/block/paride/pd.c +2 -2
@@ -943,7 +943,7 @@ static int pd_probe_drive(struct pd_unit *disk, int autoprobe, int port, goto cleanup_disk;return 0 ; cleanup_disk: -blk_cleanup_disk (disk->gd); +put_disk (disk->gd); put_disk:put_disk (p); disk->gd =NULL ;
@@ -1018,7 +1018,7 @@ static void __exit pd_exit(void)if (p) { disk->gd =NULL ;del_gendisk (p); -blk_cleanup_disk (p); +put_disk (p);blk_mq_free_tag_set (&disk->tag_set);pi_release (disk->pi); }
drivers/block/paride/pf.c +2 -2
@@ -975,7 +975,7 @@ static int __init pf_init_unit(struct pf_unit *pf, bool autoprobe, int port, out_pi_release:pi_release (pf->pi); out_free_disk: -blk_cleanup_disk (pf->disk); +put_disk (pf->disk); out_free_tag_set:blk_mq_free_tag_set (&pf->tag_set);return ret;
@@ -1044,7 +1044,7 @@ static void __exit pf_exit(void)if (!pf->present)continue ;del_gendisk (pf->disk); -blk_cleanup_disk (pf->disk); +put_disk (pf->disk);blk_mq_free_tag_set (&pf->tag_set);pi_release (pf->pi); }
drivers/block/pktcdvd.c +2 -2
@@ -2733,7 +2733,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev)return 0 ; out_mem2: -blk_cleanup_disk (disk); +put_disk (disk); out_mem:mempool_exit (&pd->rb_pool);kfree (pd);
@@ -2783,7 +2783,7 @@ static int pkt_remove_dev(dev_t pkt_dev)pkt_dbg (1 , pd,"writer unmapped\n" );del_gendisk (pd->disk); -blk_cleanup_disk (pd->disk); +put_disk (pd->disk);mempool_exit (&pd->rb_pool);kfree (pd);
drivers/block/ps3disk.c +2 -2
@@ -473,7 +473,7 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev)return 0 ; fail_cleanup_disk: -blk_cleanup_disk (gendisk); +put_disk (gendisk); fail_free_tag_set:blk_mq_free_tag_set (&priv->tag_set); fail_teardown:
@@ -500,7 +500,7 @@ static void ps3disk_remove(struct ps3_system_bus_device *_dev) &ps3disk_mask);mutex_unlock (&ps3disk_mask_mutex);del_gendisk (priv->gendisk); -blk_cleanup_disk (priv->gendisk); +put_disk (priv->gendisk);blk_mq_free_tag_set (&priv->tag_set);dev_notice (&dev->sbd.core,"Synchronizing disk cache\n" );ps3disk_sync_cache (dev);
drivers/block/ps3vram.c +2 -2
@@ -761,7 +761,7 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev)return 0 ; out_cleanup_disk: -blk_cleanup_disk (gendisk); +put_disk (gendisk); out_cache_cleanup:remove_proc_entry (DEVICE_NAME ,NULL );ps3vram_cache_cleanup (dev);
@@ -792,7 +792,7 @@ static void ps3vram_remove(struct ps3_system_bus_device *dev)struct ps3vram_priv *priv =ps3_system_bus_get_drvdata (dev);del_gendisk (priv->gendisk); -blk_cleanup_disk (priv->gendisk); +put_disk (priv->gendisk);remove_proc_entry (DEVICE_NAME ,NULL );ps3vram_cache_cleanup (dev);iounmap (priv->reports);
drivers/block/rbd.c +1 -1
@@ -4729,7 +4729,7 @@ static blk_status_t rbd_queue_rq(struct blk_mq_hw_ctx *hctx,static void rbd_free_disk (struct rbd_device *rbd_dev) { -blk_cleanup_disk (rbd_dev->disk); +put_disk (rbd_dev->disk);blk_mq_free_tag_set (&rbd_dev->tag_set); rbd_dev->disk =NULL ; }
drivers/block/rnbd/rnbd-clt.c +2 -2
@@ -1408,7 +1408,7 @@ static int rnbd_clt_setup_gen_disk(struct rnbd_clt_dev *dev, int idx)blk_queue_flag_set (QUEUE_FLAG_NONROT , dev->queue); err =add_disk (dev->gd);if (err) -blk_cleanup_disk (dev->gd); +put_disk (dev->gd);return err; }
@@ -1630,7 +1630,7 @@ struct rnbd_clt_dev *rnbd_clt_map_device(const char *sessname,static void destroy_gen_disk (struct rnbd_clt_dev *dev) {del_gendisk (dev->gd); -blk_cleanup_disk (dev->gd); +put_disk (dev->gd); } static void destroy_sysfs(struct rnbd_clt_dev *dev,
drivers/block/sunvdc.c +2 -2
@@ -886,7 +886,7 @@ static int probe_disk(struct vdc_port *port)return 0 ; out_cleanup_disk: -blk_cleanup_disk (g); +put_disk (g); out_free_tag:blk_mq_free_tag_set (&port->tag_set);return err;
@@ -1070,7 +1070,7 @@ static void vdc_port_remove(struct vio_dev *vdev)del_timer_sync (&port->vio.timer);del_gendisk (port->disk); -blk_cleanup_disk (port->disk); +put_disk (port->disk);blk_mq_free_tag_set (&port->tag_set);vdc_free_tx_ring (port);
drivers/block/swim.c +1 -1
@@ -783,7 +783,7 @@ static void swim_cleanup_floppy_disk(struct floppy_state *fs)if (fs->registered)del_gendisk (fs->disk); -blk_cleanup_disk (disk); +put_disk (disk);blk_mq_free_tag_set (&fs->tag_set); }
drivers/block/swim3.c +1 -1
@@ -1238,7 +1238,7 @@ static int swim3_attach(struct macio_dev *mdev,return 0 ; out_cleanup_disk: -blk_cleanup_disk (disk); +put_disk (disk); out_free_tag_set:blk_mq_free_tag_set (&fs->tag_set); out_unregister:
drivers/block/sx8.c +1 -1
@@ -1377,7 +1377,7 @@ static void carm_free_disk(struct carm_host *host, unsigned int port_no)if (host->state >HST_DEV_ACTIVATE )del_gendisk (disk); -blk_cleanup_disk (disk); +put_disk (disk); }static int carm_init_shm (struct carm_host *host)
drivers/block/virtio_blk.c +1 -1
@@ -1089,7 +1089,7 @@ static int virtblk_probe(struct virtio_device *vdev)return 0 ; out_cleanup_disk: -blk_cleanup_disk (vblk->disk); +put_disk (vblk->disk); out_free_tags:blk_mq_free_tag_set (&vblk->tag_set); out_free_vq:
drivers/block/xen-blkfront.c +2 -2
@@ -2382,7 +2382,7 @@ static void blkfront_connect(struct blkfront_info *info) err =device_add_disk (&info->xbdev->dev, info->gd,NULL );if (err) { -blk_cleanup_disk (info->gd); +put_disk (info->gd);blk_mq_free_tag_set (&info->tag_set); info->rq =NULL ; goto fail;
@@ -2465,7 +2465,7 @@ static int blkfront_remove(struct xenbus_device *xbdev)blkif_free (info,0 );xlbd_release_minors (info->gd->first_minor, info->gd->minors); -blk_cleanup_disk (info->gd); +put_disk (info->gd);blk_mq_free_tag_set (&info->tag_set);kfree (info);
drivers/block/z2ram.c +1 -1
@@ -337,7 +337,7 @@ static int z2ram_register_disk(int minor) z2ram_gendisk[minor] = disk; err =add_disk (disk);if (err) -blk_cleanup_disk (disk); +put_disk (disk);return err; }
drivers/block/zram/zram_drv.c +2 -2
@@ -1957,7 +1957,7 @@ static int zram_add(void)return device_id; out_cleanup_disk: -blk_cleanup_disk (zram->disk); +put_disk (zram->disk); out_free_idr:idr_remove (&zram_index_idr, device_id); out_free_dev:
@@ -2008,7 +2008,7 @@ static int zram_remove(struct zram *zram)*/ zram_reset_device (zram); -blk_cleanup_disk (zram->disk); +put_disk (zram->disk);kfree (zram);return 0 ; }
drivers/cdrom/gdrom.c +1 -1
@@ -817,7 +817,7 @@ static int probe_gdrom(struct platform_device *devptr)free_irq (HW_EVENT_GDROM_DMA , &gd);free_irq (HW_EVENT_GDROM_CMD , &gd); probe_fail_cleanup_disk: -blk_cleanup_disk (gd.disk); +put_disk (gd.disk); probe_fail_free_tag_set:blk_mq_free_tag_set (&gd.tag_set); probe_fail_free_cd_info:
drivers/md/bcache/super.c +1 -1
@@ -884,7 +884,7 @@ static void bcache_device_free(struct bcache_device *d)if (disk) {ida_simple_remove (&bcache_device_idx,first_minor_to_idx (disk->first_minor)); -blk_cleanup_disk (disk); +put_disk (disk); }bioset_exit (&d->bio_split);
drivers/md/dm.c +1 -1
@@ -1884,7 +1884,7 @@ static void cleanup_mapped_device(struct mapped_device *md)del_gendisk (md->disk); }dm_queue_destroy_crypto_profile (md->queue); -blk_cleanup_disk (md->disk); +put_disk (md->disk); }if (md->pending_io) {
drivers/md/md.c +2 -2
@@ -5579,7 +5579,7 @@ static void md_free(struct kobject *ko)if (mddev->gendisk) {del_gendisk (mddev->gendisk); -blk_cleanup_disk (mddev->gendisk); +put_disk (mddev->gendisk); }percpu_ref_exit (&mddev->writes_pending);
@@ -5718,7 +5718,7 @@ static int md_alloc(dev_t dev, char *name) out_del_gendisk:del_gendisk (disk); out_cleanup_disk: -blk_cleanup_disk (disk); +put_disk (disk); out_unlock_disks_mutex:mutex_unlock (&disks_mutex);mddev_put (mddev);
drivers/memstick/core/ms_block.c +1 -1
@@ -2129,7 +2129,7 @@ static int msb_init_disk(struct memstick_dev *card)return 0 ; out_cleanup_disk: -blk_cleanup_disk (msb->disk); +put_disk (msb->disk); out_free_tag_set:blk_mq_free_tag_set (&msb->tag_set); out_release_id:
drivers/memstick/core/mspro_block.c +1 -1
@@ -1209,7 +1209,7 @@ static int mspro_block_init_disk(struct memstick_dev *card)return 0 ; out_cleanup_disk: -blk_cleanup_disk (msb->disk); +put_disk (msb->disk); out_free_tag_set:blk_mq_free_tag_set (&msb->tag_set); out_release_id:
drivers/mtd/mtd_blkdevs.c +2 -2
@@ -29,7 +29,7 @@ static void blktrans_dev_release(struct kref *kref)struct mtd_blktrans_dev *dev = container_of(kref, struct mtd_blktrans_dev, ref); -blk_cleanup_disk (dev->disk); +put_disk (dev->disk);blk_mq_free_tag_set (dev->tag_set);kfree (dev->tag_set);list_del (&dev->list);
@@ -398,7 +398,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)return 0 ; out_cleanup_disk: -blk_cleanup_disk (new->disk); +put_disk (new->disk); out_free_tag_set:blk_mq_free_tag_set (new->tag_set); out_kfree_tag_set:
drivers/mtd/ubi/block.c +2 -2
@@ -467,7 +467,7 @@ int ubiblock_create(struct ubi_volume_info *vi) out_remove_minor:idr_remove (&ubiblock_minor_idr, gd->first_minor); out_cleanup_disk: -blk_cleanup_disk (dev->gd); +put_disk (dev->gd); out_free_tags:blk_mq_free_tag_set (&dev->tag_set); out_free_dev:
@@ -486,7 +486,7 @@ static void ubiblock_cleanup(struct ubiblock *dev)destroy_workqueue (dev->wq);/* Finally destroy the blk queue */ dev_info (disk_to_dev (dev->gd),"released" ); -blk_cleanup_disk (dev->gd); +put_disk (dev->gd);blk_mq_free_tag_set (&dev->tag_set);idr_remove (&ubiblock_minor_idr, dev->gd->first_minor); }
drivers/nvdimm/btt.c +2 -2
@@ -1548,14 +1548,14 @@ static int btt_blk_init(struct btt *btt)return 0 ; out_cleanup_disk: -blk_cleanup_disk (btt->btt_disk); +put_disk (btt->btt_disk);return rc; }static void btt_blk_cleanup (struct btt *btt) {del_gendisk (btt->btt_disk); -blk_cleanup_disk (btt->btt_disk); +put_disk (btt->btt_disk); }/**
drivers/nvdimm/pmem.c +2 -2
@@ -450,7 +450,7 @@ static void pmem_release_disk(void *__pmem)put_dax (pmem->dax_dev);del_gendisk (pmem->disk); -blk_cleanup_disk (pmem->disk); +put_disk (pmem->disk); } static int pmem_attach_disk(struct device *dev,
@@ -596,7 +596,7 @@ static int pmem_attach_disk(struct device *dev,kill_dax (pmem->dax_dev);put_dax (pmem->dax_dev); out: -blk_cleanup_disk (pmem->disk); +put_disk (pmem->disk);return rc; }
drivers/nvme/host/core.c +1 -1
@@ -4047,7 +4047,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid,mutex_unlock (&ctrl->subsys->lock);nvme_put_ns_head (ns->head); out_cleanup_disk: -blk_cleanup_disk (disk); +put_disk (disk); out_free_ns:kfree (ns); out_free_id:
drivers/nvme/host/multipath.c +1 -1
@@ -853,7 +853,7 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head)/* make sure all pending bios are cleaned up */ kblockd_schedule_work (&head->requeue_work);flush_work (&head->requeue_work); -blk_cleanup_disk (head->disk); +put_disk (head->disk); }void nvme_mpath_init_ctrl (struct nvme_ctrl *ctrl)
drivers/s390/block/dcssblk.c +4 -4
@@ -414,7 +414,7 @@ dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const chkill_dax (dev_info->dax_dev);put_dax (dev_info->dax_dev);del_gendisk (dev_info->gd); -blk_cleanup_disk (dev_info->gd); +put_disk (dev_info->gd);up_write (&dcssblk_devices_sem);if (device_remove_file_self (dev, attr)) {
@@ -712,7 +712,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const charput_dax (dev_info->dax_dev); put_dev:list_del (&dev_info->lh); -blk_cleanup_disk (dev_info->gd); +put_disk (dev_info->gd);list_for_each_entry (seg_info, &dev_info->seg_list, lh) {segment_unload (seg_info->segment_name); }
@@ -722,7 +722,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char dev_list_del:list_del (&dev_info->lh); release_gd: -blk_cleanup_disk (dev_info->gd); +put_disk (dev_info->gd);up_write (&dcssblk_devices_sem); seg_list_del:if (dev_info ==NULL )
@@ -790,7 +790,7 @@ dcssblk_remove_store(struct device *dev, struct device_attribute *attr, const chkill_dax (dev_info->dax_dev);put_dax (dev_info->dax_dev);del_gendisk (dev_info->gd); -blk_cleanup_disk (dev_info->gd); +put_disk (dev_info->gd);/* unload all related segments */ list_for_each_entry (entry, &dev_info->seg_list, lh)
drivers/s390/block/scm_blk.c +2 -2
@@ -501,7 +501,7 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev)return 0 ; out_cleanup_disk: -blk_cleanup_disk (bdev->gendisk); +put_disk (bdev->gendisk); out_tag:blk_mq_free_tag_set (&bdev->tag_set); out:
@@ -512,7 +512,7 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev)void scm_blk_dev_cleanup (struct scm_blk_dev *bdev) {del_gendisk (bdev->gendisk); -blk_cleanup_disk (bdev->gendisk); +put_disk (bdev->gendisk);blk_mq_free_tag_set (&bdev->tag_set); }
include/linux/blkdev.h +0 -1
@@ -830,7 +830,6 @@ struct gendisk *__blk_alloc_disk(int node, struct lock_class_key *lkclass); \__blk_alloc_disk (node_id, &__key); \ }) -void blk_cleanup_disk (struct gendisk *disk);int __register_blkdev (unsigned int major,const char *name,void (*probe)(dev_t devt));
Signature · 1 line
2.30.2
Re: [PATCH 6/6] block: remove blk_cleanup_disk
Quoted 45 lines · Christoph Hellwig
blk_cleanup_diskis nothing but a trivial wrapper forput_disknow, so remove it.Signed-off-by Christoph Hellwig <[email protected]>--- arch/m68k/emu/nfblock.c | 4 ++-- arch/um/drivers/ubd_kern.c | 4 ++-- arch/xtensa/platforms/iss/simdisk.c | 4 ++-- block/genhd.c | 15 --------------- drivers/block/amiflop.c | 2 +- drivers/block/aoe/aoeblk.c | 2 +- drivers/block/aoe/aoedev.c | 2 +- drivers/block/ataflop.c | 4 ++-- drivers/block/brd.c | 4 ++-- drivers/block/drbd/drbd_main.c | 4 ++-- drivers/block/floppy.c | 6 +++--- drivers/block/loop.c | 2 +- drivers/block/mtip32xx/mtip32xx.c | 2 +- drivers/block/n64cart.c | 2 +- drivers/block/nbd.c | 4 ++-- drivers/block/null_blk/main.c | 4 ++-- drivers/block/paride/pcd.c | 4 ++-- drivers/block/paride/pd.c | 4 ++-- drivers/block/paride/pf.c | 4 ++-- drivers/block/pktcdvd.c | 4 ++-- drivers/block/ps3disk.c | 4 ++-- drivers/block/ps3vram.c | 4 ++-- drivers/block/rbd.c | 2 +- drivers/block/rnbd/rnbd-clt.c | 4 ++-- drivers/block/sunvdc.c | 4 ++-- drivers/block/swim.c | 2 +- drivers/block/swim3.c | 2 +- drivers/block/sx8.c | 2 +- drivers/block/virtio_blk.c | 2 +- drivers/block/xen-blkfront.c | 4 ++-- drivers/block/z2ram.c | 2 +- drivers/block/zram/zram_drv.c | 4 ++-- drivers/cdrom/gdrom.c | 2 +- drivers/md/bcache/super.c | 2 +- drivers/md/dm.c | 2 +- drivers/md/md.c | 4 ++-- drivers/memstick/core/ms_block.c | 2 +- drivers/memstick/core/mspro_block.c | 2 +- drivers/mtd/mtd_blkdevs.c | 4 ++-- drivers/mtd/ubi/block.c | 4 ++--
Quoted 9 lines
drivers/nvdimm/btt.c | 4 ++-- drivers/nvdimm/pmem.c | 4 ++-- drivers/nvme/host/core.c | 2 +- drivers/nvme/host/multipath.c | 2 +- drivers/s390/block/dcssblk.c | 8 ++++---- drivers/s390/block/scm_blk.c | 4 ++-- include/linux/blkdev.h | 1 - 47 files changed, 74 insertions(+), 90 deletions(-)
I wish we could have blktests for tearing down device-drivers; doing a regression test here will be really hard.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
Christoph Hellwig
maintainerRe: [PATCH 6/6] block: remove blk_cleanup_disk
Quoted 2 lines · Hannes Reinecke
I wish we could have blktests for tearing down device-drivers; doing a regression test here will be really hard.
The problem with a remove is that while we have a generic device remove attribute, it:
a) isn't always in the same place relatively to the disk
b) once removed we have no generic way to add the device back for further testing
nvme/032 has basic remove testing for nvme, and I think I can also wire up my scsi bind/unbind testing for blktests using scsi_debug without too much effort. But that still isn't exactly a generic test.
Re: [PATCH 6/6] block: remove blk_cleanup_disk
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · Hannes Reinecke
I wish we could have blktests for tearing down device-drivers; doing a regression test here will be really hard.
The problem with a remove is that while we have a generic device remove attribute, it:
Quoted 7 lines
a) isn't always in the same place relatively to the disk
b) once removed we have no generic way to add the device back for further testingnvme/032 has basic remove testing for nvme, and I think I can also wire up my scsi bind/unbind testing for blktests using
scsi_debugwithout too much effort. But that still isn't exactly a generic test.
Precisely my sentiment. This patchset is touch a _lot_ of drivers, and modifying the removal path of each. Looking obvious from initial glance, but as usual the devil's in the detail. Or, to quote my QA maxim:
'The only way to be ensure it works is to ensure it works.'
But anyway, probably just wishful thinking.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer
Sagi Grimberg
maintainerRe: [PATCH 6/6] block: remove blk_cleanup_disk
In reply to Christoph HellwigQuoted 7 lines
Quoted 3 lines
I wish we could have blktests for tearing down device-drivers; doing a regression test here will be really hard.
The problem with a remove is that while we have a generic device remove attribute, it:
Quoted 7 lines
a) isn't always in the same place relatively to the disk
b) once removed we have no generic way to add the device back for further testingnvme/032 has basic remove testing for nvme, and I think I can also wire up my scsi bind/unbind testing for blktests using
scsi_debugwithout too much effort. But that still isn't exactly a generic test.
It should be trivial to add a similar test for fabrics with toggling nvmet $ns/enable config knob...
Jens Axboe
maintainerQuoted 3 lines · Christoph Hellwig
Note that while intended or 5.20, this series is generated against the block-5.19 branch as that contains fixes in this area that haven't made it to the for-5.10/block branch yet.
Side note - I rebased on -rc3 anyway because of the series that went into -rc2, so we should be fine there.
Signature · 1 line
Jens Axboe
Christoph Hellwig
maintainerQuoted 7 lines · Jens Axboe
Quoted 3 lines · Christoph Hellwig
Note that while intended or 5.20, this series is generated against the block-5.19 branch as that contains fixes in this area that haven't made it to the for-5.10/block branch yet.
Side note - I rebased on -rc3 anyway because of the series that went into -rc2, so we should be fine there.
It depends on elevator/debugfs teardown series that has not made it into -rc3.
Jens Axboe
maintainerQuoted 11 lines · Christoph Hellwig
Quoted 7 lines · Jens Axboe
Quoted 3 lines · Christoph Hellwig
Note that while intended or 5.20, this series is generated against the block-5.19 branch as that contains fixes in this area that haven't made it to the for-5.10/block branch yet.
Side note - I rebased on -rc3 anyway because of the series that went into -rc2, so we should be fine there.
It depends on elevator/debugfs teardown series that has not made it into -rc3.
Guess we'll rebase for -rc4 again...
Signature · 1 line
Jens Axboe
Christoph Hellwig
maintainerQuoted 7 lines · Jens Axboe
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Jens Axboe
Quoted 3 lines · Christoph Hellwig
Note that while intended or 5.20, this series is generated against the block-5.19 branch as that contains fixes in this area that haven't made it to the for-5.10/block branch yet.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Side note - I rebased on -rc3 anyway because of the series that went into -rc2, so we should be fine there.
It depends on elevator/debugfs teardown series that has not made it into -rc3.
Guess we'll rebase for -rc4 again...
As you'd done that, can you consider this series now?
Jens Axboe
maintainerQuoted 11 lines · Christoph Hellwig
Quoted 10 lines · Jens Axboe
Quoted 9 lines · Christoph Hellwig
Quoted 7 lines · Jens Axboe
Quoted 3 lines · Christoph Hellwig
Note that while intended or 5.20, this series is generated against the block-5.19 branch as that contains fixes in this area that haven't made it to the for-5.10/block branch yet.
Side note - I rebased on -rc3 anyway because of the series that went into -rc2, so we should be fine there.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
It depends on elevator/debugfs teardown series that has not made it into -rc3.
Guess we'll rebase for -rc4 again...
As you'd done that, can you consider this series now?
It doesn't apply cleanly. I'll check if it's something minor...
Signature · 1 line
Jens Axboe
Jens Axboe
maintainerQuoted 12 lines · Jens Axboe
Quoted 11 lines · Christoph Hellwig
Quoted 10 lines · Jens Axboe
Quoted 9 lines · Christoph Hellwig
Quoted 7 lines · Jens Axboe
Quoted 3 lines · Christoph Hellwig
Note that while intended or 5.20, this series is generated against the block-5.19 branch as that contains fixes in this area that haven't made it to the for-5.10/block branch yet.
Side note - I rebased on -rc3 anyway because of the series that went into -rc2, so we should be fine there.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
It depends on elevator/debugfs teardown series that has not made it into -rc3.
Guess we'll rebase for -rc4 again...
As you'd done that, can you consider this series now?
It doesn't apply cleanly. I'll check if it's something minor...
Minor thing in xen-blkfront for the last patch, hand edited the patch:
Signature · 1 line
Jens Axboe
Quoted 9 lines · Christoph Hellwig
this series simplifies teardown for most block drivers. Right now they also have to call
blk_cleanup_queueafter callingdel_gendisk, making the teardown process rather confusing.Instead this series records if the
request_queueis owned by the gendisk, which is always the case except for scsi and dasd or queues without a gendisk at all, and then does the entire teardown indel_gendisk.[...]
Applied, thanks!
[1/6] mtip32xx: remove the device_status debugfs file
commit: ec5263f422a3364442e0db2d9c2866d9154cbcc4
[2/6] mtip32xx: fix device removal
commit: e8b58ef09e84c15cf782b01cfc73cc5b1180d519
[3/6] block: remove QUEUE_FLAG_DEAD
commit: 1f90307e5f0d7bc9a336ead528f616a5df8e5944
[4/6] block: stop setting the nomerges flags in blk_cleanup_queue
commit: 0e3534022f26ae51f7cf28347a253230604b6f4e
[5/6] block: simplify disk shutdown
commit: 6f8191fdf41d3a53cc1d63fe2234e812c55a0092
[6/6] block: remove blk_cleanup_disk
commit: 8b9ab62662048a3274361c7e5f64037c2c133e2cBest regards,
Signature · 1 line
Jens Axboe