From: Neil Brown <neilb@suse.com>
To: gregkh@linuxfoundation.org, heinzm@redhat.com
Cc: stable@vger.kernel.org
Subject: [PATCH 3.1[04]-stable] md: flush ->event_work before stopping array.
Date: Wed, 30 Sep 2015 13:11:22 +1000 [thread overview]
Message-ID: <877fn8mwit.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <14432874412156@kroah.com>
[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]
commit ee5d004fd0591536a061451eba2b187092e9127c upstream.
The 'event_work' worker used by dm-raid may still be running
when the array is stopped. This can result in an oops.
So flush the workqueue on which it is run after detaching
and before destroying the device.
Reported-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Cc: stable@vger.kernel.org (2.6.38+ please delay 2 weeks after -final release)
Fixes: 9d09e663d550 ("dm: raid456 basic support")
---
Here is the patch rebased on 3.14 as requested.
This same patch applies to 3.10 too.
Thanks.
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4ad5cc4e63e8..4bb537a35428 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5285,6 +5285,8 @@ EXPORT_SYMBOL_GPL(md_stop_writes);
static void __md_stop(struct mddev *mddev)
{
mddev->ready = 0;
+ /* Ensure ->event_work is done */
+ flush_workqueue(md_misc_wq);
mddev->pers->stop(mddev);
if (mddev->pers->sync_request && mddev->to_remove == NULL)
mddev->to_remove = &md_redundancy_group;
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2015-09-30 3:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-26 17:10 FAILED: patch "[PATCH] md: flush ->event_work before stopping array." failed to apply to 3.14-stable tree gregkh
2015-09-30 3:11 ` Neil Brown [this message]
2015-10-02 10:02 ` [PATCH 3.1[04]-stable] md: flush ->event_work before stopping array Jiri Slaby
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=877fn8mwit.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=gregkh@linuxfoundation.org \
--cc=heinzm@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).