This is a note to let you know that I've just added the patch titled mtip32xx: Fix for rmmod crash when drive is in FTL rebuild to the 4.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mtip32xx-fix-for-rmmod-crash-when-drive-is-in-ftl-rebuild.patch and it can be found in the queue-4.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 59cf70e236c96594d9f1e065755d8fce9df5356b Mon Sep 17 00:00:00 2001 From: Asai Thambi SP <asamymuthupa@xxxxxxxxxx> Date: Wed, 24 Feb 2016 21:17:47 -0800 Subject: mtip32xx: Fix for rmmod crash when drive is in FTL rebuild From: Asai Thambi SP <asamymuthupa@xxxxxxxxxx> commit 59cf70e236c96594d9f1e065755d8fce9df5356b upstream. When FTL rebuild is in progress, alloc_disk() initializes the disk but device node will be created by add_disk() only after successful completion of FTL rebuild. So, skip deletion of device node in removal path when FTL rebuild is in progress. Signed-off-by: Selvan Mani <smani@xxxxxxxxxx> Signed-off-by: Asai Thambi S P <asamymuthupa@xxxxxxxxxx> Signed-off-by: Jens Axboe <axboe@xxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/block/mtip32xx/mtip32xx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2968,10 +2968,8 @@ restart_eh: } if (test_bit(MTIP_PF_REBUILD_BIT, &port->flags)) { - if (mtip_ftl_rebuild_poll(dd) < 0) - set_bit(MTIP_DDF_REBUILD_FAILED_BIT, - &dd->dd_flag); - clear_bit(MTIP_PF_REBUILD_BIT, &port->flags); + if (mtip_ftl_rebuild_poll(dd) == 0) + clear_bit(MTIP_PF_REBUILD_BIT, &port->flags); } } @@ -3851,7 +3849,6 @@ static int mtip_block_initialize(struct mtip_hw_debugfs_init(dd); -skip_create_disk: memset(&dd->tags, 0, sizeof(dd->tags)); dd->tags.ops = &mtip_mq_ops; dd->tags.nr_hw_queues = 1; @@ -3881,6 +3878,7 @@ skip_create_disk: dd->disk->queue = dd->queue; dd->queue->queuedata = dd; +skip_create_disk: /* Initialize the protocol layer. */ wait_for_rebuild = mtip_hw_get_identify(dd); if (wait_for_rebuild < 0) { @@ -4041,7 +4039,8 @@ static int mtip_block_remove(struct driv dd->bdev = NULL; } if (dd->disk) { - del_gendisk(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); @@ -4082,7 +4081,8 @@ static int mtip_block_shutdown(struct dr dev_info(&dd->pdev->dev, "Shutting down %s ...\n", dd->disk->disk_name); - del_gendisk(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); Patches currently in stable-queue which might be from asamymuthupa@xxxxxxxxxx are queue-4.5/mtip32xx-print-exact-time-when-an-internal-command-is-interrupted.patch queue-4.5/mtip32xx-implement-timeout-handler.patch queue-4.5/mtip32xx-cleanup-queued-requests-after-surprise-removal.patch queue-4.5/mtip32xx-avoid-issuing-standby-immediate-cmd-during-ftl-rebuild.patch queue-4.5/mtip32xx-handle-safe-removal-during-io.patch queue-4.5/mtip32xx-remove-unwanted-code-from-taskfile-error-handler.patch queue-4.5/mtip32xx-handle-ftl-rebuild-failure-state-during-device-initialization.patch queue-4.5/mtip32xx-fix-for-rmmod-crash-when-drive-is-in-ftl-rebuild.patch queue-4.5/mtip32xx-fix-broken-service-thread-handling.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html