From: <gregkh@linuxfoundation.org>
To: asamymuthupa@micron.com, axboe@fb.com,
gregkh@linuxfoundation.org, rsambandam@micron.com,
smani@micron.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "mtip32xx: Handle safe removal during IO" has been added to the 4.4-stable tree
Date: Sat, 09 Apr 2016 17:40:56 -0700 [thread overview]
Message-ID: <146024885679113@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
mtip32xx: Handle safe removal during IO
to the 4.4-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-handle-safe-removal-during-io.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 51c6570eb922146470c2fe660c34585414679bd6 Mon Sep 17 00:00:00 2001
From: Asai Thambi SP <asamymuthupa@micron.com>
Date: Wed, 24 Feb 2016 21:18:10 -0800
Subject: mtip32xx: Handle safe removal during IO
From: Asai Thambi SP <asamymuthupa@micron.com>
commit 51c6570eb922146470c2fe660c34585414679bd6 upstream.
Flush inflight IOs using fsync_bdev() when the device is safely
removed. Also, block further IOs in device open function.
Signed-off-by: Selvan Mani <smani@micron.com>
Signed-off-by: Rajesh Kumar Sambandam <rsambandam@micron.com>
Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/block/mtip32xx/mtip32xx.c | 34 ++++++++++++++++++++++++++++++++--
drivers/block/mtip32xx/mtip32xx.h | 1 +
2 files changed, 33 insertions(+), 2 deletions(-)
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -3602,6 +3602,28 @@ static int mtip_block_getgeo(struct bloc
return 0;
}
+static int mtip_block_open(struct block_device *dev, fmode_t mode)
+{
+ 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;
+}
+
+void mtip_block_release(struct gendisk *disk, fmode_t mode)
+{
+}
+
/*
* Block device operation function.
*
@@ -3609,6 +3631,8 @@ static int mtip_block_getgeo(struct bloc
* 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,
@@ -4434,7 +4458,7 @@ static void mtip_pci_remove(struct pci_d
struct driver_data *dd = pci_get_drvdata(pdev);
unsigned long flags, to;
- set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag);
+ set_bit(MTIP_DDF_REMOVAL_BIT, &dd->dd_flag);
spin_lock_irqsave(&dev_lock, flags);
list_del_init(&dd->online_list);
@@ -4451,12 +4475,18 @@ static void mtip_pci_remove(struct pci_d
} while (atomic_read(&dd->irq_workers_active) != 0 &&
time_before(jiffies, to));
+ fsync_bdev(dd->bdev);
+
if (atomic_read(&dd->irq_workers_active) != 0) {
dev_warn(&dd->pdev->dev,
"Completion workers still active!\n");
}
- blk_mq_stop_hw_queues(dd->queue);
+ if (dd->sr)
+ blk_mq_stop_hw_queues(dd->queue);
+
+ set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag);
+
/* Clean up the block layer. */
mtip_block_remove(dd);
--- a/drivers/block/mtip32xx/mtip32xx.h
+++ b/drivers/block/mtip32xx/mtip32xx.h
@@ -158,6 +158,7 @@ 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) |
Patches currently in stable-queue which might be from asamymuthupa@micron.com are
queue-4.4/mtip32xx-print-exact-time-when-an-internal-command-is-interrupted.patch
queue-4.4/mtip32xx-implement-timeout-handler.patch
queue-4.4/mtip32xx-cleanup-queued-requests-after-surprise-removal.patch
queue-4.4/mtip32xx-avoid-issuing-standby-immediate-cmd-during-ftl-rebuild.patch
queue-4.4/mtip32xx-handle-safe-removal-during-io.patch
queue-4.4/mtip32xx-remove-unwanted-code-from-taskfile-error-handler.patch
queue-4.4/mtip32xx-handle-ftl-rebuild-failure-state-during-device-initialization.patch
queue-4.4/mtip32xx-fix-for-rmmod-crash-when-drive-is-in-ftl-rebuild.patch
queue-4.4/mtip32xx-fix-broken-service-thread-handling.patch
reply other threads:[~2016-04-10 0:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=146024885679113@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=asamymuthupa@micron.com \
--cc=axboe@fb.com \
--cc=rsambandam@micron.com \
--cc=smani@micron.com \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.