patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Junxiao Bi <junxiao.bi@oracle.com>,
	Yu Kuai <yukuai3@huawei.com>, Song Liu <song@kernel.org>
Subject: [PATCH 6.7 15/28] Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"
Date: Thu, 18 Jan 2024 11:49:05 +0100	[thread overview]
Message-ID: <20240118104301.754560579@linuxfoundation.org> (raw)
In-Reply-To: <20240118104301.249503558@linuxfoundation.org>

6.7-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Junxiao Bi <junxiao.bi@oracle.com>

commit bed9e27baf52a09b7ba2a3714f1e24e17ced386d upstream.

This reverts commit 5e2cf333b7bd5d3e62595a44d598a254c697cd74.

That commit introduced the following race and can cause system hung.

 md_write_start:             raid5d:
 // mddev->in_sync == 1
 set "MD_SB_CHANGE_PENDING"
                            // running before md_write_start wakeup it
                             waiting "MD_SB_CHANGE_PENDING" cleared
                             >>>>>>>>> hung
 wakeup mddev->thread
 ...
 waiting "MD_SB_CHANGE_PENDING" cleared
 >>>> hung, raid5d should clear this flag
 but get hung by same flag.

The issue reverted commit fixing is fixed by last patch in a new way.

Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d")
Cc: stable@vger.kernel.org # v5.19+
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231108182216.73611-2-junxiao.bi@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/md/raid5.c |   12 ------------
 1 file changed, 12 deletions(-)

--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -36,7 +36,6 @@
  */
 
 #include <linux/blkdev.h>
-#include <linux/delay.h>
 #include <linux/kthread.h>
 #include <linux/raid/pq.h>
 #include <linux/async_tx.h>
@@ -6820,18 +6819,7 @@ static void raid5d(struct md_thread *thr
 			spin_unlock_irq(&conf->device_lock);
 			md_check_recovery(mddev);
 			spin_lock_irq(&conf->device_lock);
-
-			/*
-			 * Waiting on MD_SB_CHANGE_PENDING below may deadlock
-			 * seeing md_check_recovery() is needed to clear
-			 * the flag when using mdmon.
-			 */
-			continue;
 		}
-
-		wait_event_lock_irq(mddev->sb_wait,
-			!test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags),
-			conf->device_lock);
 	}
 	pr_debug("%d stripes handled\n", handled);
 



  parent reply	other threads:[~2024-01-18 10:51 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 10:48 [PATCH 6.7 00/28] 6.7.1-rc1 review Greg Kroah-Hartman
2024-01-18 10:48 ` [PATCH 6.7 01/28] f2fs: explicitly null-terminate the xattr list Greg Kroah-Hartman
2024-01-18 10:48 ` [PATCH 6.7 02/28] ALSA: hda/realtek: Add quirks for Dell models Greg Kroah-Hartman
2024-01-18 10:48 ` [PATCH 6.7 03/28] ALSA: hda: cs35l41: Support additional Dell models without _DSD Greg Kroah-Hartman
2024-01-18 10:48 ` [PATCH 6.7 04/28] ALSA: hda: cs35l41: Prevent firmware load if SPI speed too low Greg Kroah-Hartman
2024-01-18 10:48 ` [PATCH 6.7 05/28] ALSA: hda: Add driver properties for cs35l41 for Lenovo Legion Slim 7 Gen 8 serie Greg Kroah-Hartman
2024-01-18 10:48 ` [PATCH 6.7 06/28] ALSA: hda/realtek: enable SND_PCI_QUIRK for Lenovo Legion Slim 7 Gen 8 (2023) serie Greg Kroah-Hartman
2024-01-18 10:48 ` [PATCH 6.7 07/28] ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP Envy X360 13-ay0xxx Greg Kroah-Hartman
2024-01-18 10:48 ` [PATCH 6.7 08/28] ALSA: hda: cs35l41: Support more HP models without _DSD Greg Kroah-Hartman
2024-01-18 10:48 ` [PATCH 6.7 09/28] ACPI: resource: Add another DMI match for the TongFang GMxXGxx Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 10/28] bus: moxtet: Mark the irq as shared Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 11/28] bus: moxtet: Add spi device table Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 12/28] drm/amd/display: Pass pwrseq inst for backlight and ABM Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 13/28] ksmbd: dont allow O_TRUNC open on read-only share Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 14/28] ksmbd: free ppace array on error in parse_dacl Greg Kroah-Hartman
2024-01-18 10:49 ` Greg Kroah-Hartman [this message]
2024-01-18 10:49 ` [PATCH 6.7 16/28] binder: use EPOLLERR from eventpoll.h Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 17/28] binder: fix use-after-free in shinkers callback Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 18/28] binder: fix trivial typo of binder_free_buf_locked() Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 19/28] binder: fix comment on binder_alloc_new_buf() return value Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 20/28] uio: Fix use-after-free in uio_open Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 21/28] parport: parport_serial: Add Brainboxes BAR details Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 22/28] parport: parport_serial: Add Brainboxes device IDs and geometry Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 23/28] leds: ledtrig-tty: Free allocated ttyname buffer on deactivate Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 24/28] PCI: Add ACS quirk for more Zhaoxin Root Ports Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 25/28] coresight: etm4x: Fix width of CCITMIN field Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 26/28] scripts/decode_stacktrace.sh: optionally use LLVM utilities Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 27/28] docs: kernel_feat.py: fix potential command injection Greg Kroah-Hartman
2024-01-18 10:49 ` [PATCH 6.7 28/28] mm/memory_hotplug: fix memmap_on_memory sysfs value retrieval Greg Kroah-Hartman
2024-01-18 16:35 ` [PATCH 6.7 00/28] 6.7.1-rc1 review Allen
2024-01-18 19:51 ` Florian Fainelli
2024-01-18 20:17 ` SeongJae Park
2024-01-19  0:43 ` Shuah Khan
2024-01-19  4:30 ` Ron Economos
2024-01-19  6:45 ` Bagas Sanjaya
2024-01-19 13:49 ` Ricardo B. Marliere
2024-01-19 14:14 ` Jon Hunter
2024-01-19 15:48 ` Naresh Kamboju
2024-01-19 16:01   ` Greg Kroah-Hartman
2024-01-19 17:35     ` Naresh Kamboju
2024-01-19 17:53   ` Luna Jernberg
2024-01-20  3:31 ` Justin Forbes

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=20240118104301.754560579@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=junxiao.bi@oracle.com \
    --cc=patches@lists.linux.dev \
    --cc=song@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yukuai3@huawei.com \
    /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).