From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:47221 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755248AbcDJAlK (ORCPT ); Sat, 9 Apr 2016 20:41:10 -0400 Subject: Patch "mtip32xx: Fix for rmmod crash when drive is in FTL rebuild" has been added to the 4.5-stable tree To: asamymuthupa@micron.com, axboe@fb.com, gregkh@linuxfoundation.org, smani@micron.com Cc: , From: Date: Sat, 09 Apr 2016 17:41:08 -0700 Message-ID: <146024886896137@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From 59cf70e236c96594d9f1e065755d8fce9df5356b Mon Sep 17 00:00:00 2001 From: Asai Thambi SP 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 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 Signed-off-by: Asai Thambi S P Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- 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@micron.com 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