Skip to contentSkip to conversation

FAILED: patch "[PATCH] md: flush ->event_work before stopping array." failed to apply to 3.14-stable tree

PATCH Applied [email protected] 3 participants 3 messages Sep 26, 2015 – Oct 2, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 3.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From ee5d004fd0591536a061451eba2b187092e9127c Mon Sep 17 00:00:00 2001

From: NeilBrown <[email protected]>
Date: Wed, 22 Jul 2015 10:20:07 +1000
Subject: [PATCH] md: flush ->event_work before stopping array.

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.

Cc [email protected] (2.6.38+ please delay 2 weeks after -final release)
Fixes 9d09e663d550 ("dm: raid456 basic support")
drivers/md/md.c +2 -0
index df92d30ca054..5025b3ec13cd 100644
@@ -5382,6 +5382,8 @@ static void __md_stop(struct mddev *mddev)
 {
 	struct md_personality *pers = mddev->pers;
 	mddev_detach(mddev);
+	/* Ensure ->event_work is done */
+	flush_workqueue(md_misc_wq);
 	spin_lock(&mddev->lock);
 	mddev->ready = 0;
 	mddev->pers = NULL;
#1 lore raw

PATCH 1/1 -stable] md: flush ->event_work before stopping array.

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.

Cc [email protected] (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.

drivers/md/md.c +2 -0
index 4ad5cc4e63e8..4bb537a35428 100644
@@ -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;
Applied
#2 lore raw

Re: [PATCH 3.1[04]-stable] md: flush ->event_work before stopping array.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Quoted 6 lines · Neil Brown

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.

Quoted 7 lines

So flush the workqueue on which it is run after detaching and before destroying the device.

NeilBrown <[email protected]> Cc: [email protected] (2.6.38+ please delay 2 weeks after -final release) Fixes: 9d09e663d550 ("dm: raid456 basic support")

Applied to 3.12. Thanks!

- --
js
suse labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWDlY5AAoJEL0lsQQGtHBJHfIP/1Uh6W27/UCBUOi/IRb+tzIv N7Mxa0BfalrxsvVCHx0PoSJtQVqnvE+U0ZuFSnfFMOQNbyXBVYMfM2usJG5V/Us8 lSkctYgxA6wRhZg3TwCFNPs+wKEdqxlFuNL0C3/3esQR2JWA7AuRz8/vZc3wxOgL RmwNictTJhV1B2kmAzViRyqM93H2JObPMtOjoQyEQGfnV6AOzTthjW8v7acAA+i+ 8gTGkP5D17sZv33WaLXoUy/aKbRZtcVNdrIc1V9XD6W3o0EiHUhuUpA+wRz3AXh1 tTyjq09PCz4SWwuUhiYWKfBSpBY6wxHub6+DUHEQbXh55TzJvfBIcnbsK5TOqjpp RuYwqG28D43IHfW/BffsSIQIayXZ/ZfSXtVV+oRkhY4P9MrMAQ7T/WeLhZNJq71S pHxAu5RNPGHtVHs+K/j8M/+f8FJ0hCCOLEJY1La7lt4V3yjMsq5Z5/B9UTHp74EG mZJZfEsypFfGSLM4sT1406d/Dz/cqA82bexNzZgGdMOZ7IT1e9fnQ42AOGWQqJdD uPg5uQgL+mAjzs00oPdnLhdSIVYFQh4FrGz2Fpv1W+m4chtPu5AkUbUJA1tdqVep PZInXfmgdfu05tP2Dqn1d6fe/YTS2W/gBYhDrVVT5Eb/Fk73AXCF1RkJHVMTVXOn bjmtvqpsjQnT5MtSbUq/
=B7xJ
-----END PGP SIGNATURE-----