]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-5.1/raid5-cache-need-to-do-start-part-job-after-adding-journal-device.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.1 / raid5-cache-need-to-do-start-part-job-after-adding-journal-device.patch
CommitLineData
8da4beba
GKH
1From d9771f5ec46c282d518b453c793635dbdc3a2a94 Mon Sep 17 00:00:00 2001
2From: Xiao Ni <xni@redhat.com>
3Date: Fri, 14 Jun 2019 15:41:05 -0700
4Subject: raid5-cache: Need to do start() part job after adding journal device
5
6From: Xiao Ni <xni@redhat.com>
7
8commit d9771f5ec46c282d518b453c793635dbdc3a2a94 upstream.
9
10commit d5d885fd514f ("md: introduce new personality funciton start()")
11splits the init job to two parts. The first part run() does the jobs that
12do not require the md threads. The second part start() does the jobs that
13require the md threads.
14
15Now it just does run() in adding new journal device. It needs to do the
16second part start() too.
17
18Fixes: d5d885fd514f ("md: introduce new personality funciton start()")
19Cc: stable@vger.kernel.org #v4.9+
20Reported-by: Michal Soltys <soltys@ziu.info>
21Signed-off-by: Xiao Ni <xni@redhat.com>
22Signed-off-by: Song Liu <songliubraving@fb.com>
23Signed-off-by: Jens Axboe <axboe@kernel.dk>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26---
27 drivers/md/raid5.c | 11 +++++++++--
28 1 file changed, 9 insertions(+), 2 deletions(-)
29
30--- a/drivers/md/raid5.c
31+++ b/drivers/md/raid5.c
32@@ -7674,7 +7674,7 @@ abort:
33 static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
34 {
35 struct r5conf *conf = mddev->private;
36- int err = -EEXIST;
37+ int ret, err = -EEXIST;
38 int disk;
39 struct disk_info *p;
40 int first = 0;
41@@ -7689,7 +7689,14 @@ static int raid5_add_disk(struct mddev *
42 * The array is in readonly mode if journal is missing, so no
43 * write requests running. We should be safe
44 */
45- log_init(conf, rdev, false);
46+ ret = log_init(conf, rdev, false);
47+ if (ret)
48+ return ret;
49+
50+ ret = r5l_start(conf->log);
51+ if (ret)
52+ return ret;
53+
54 return 0;
55 }
56 if (mddev->recovery_disabled == conf->recovery_disabled)