]>
Commit | Line | Data |
---|---|---|
8da4beba GKH |
1 | From d9771f5ec46c282d518b453c793635dbdc3a2a94 Mon Sep 17 00:00:00 2001 |
2 | From: Xiao Ni <xni@redhat.com> | |
3 | Date: Fri, 14 Jun 2019 15:41:05 -0700 | |
4 | Subject: raid5-cache: Need to do start() part job after adding journal device | |
5 | ||
6 | From: Xiao Ni <xni@redhat.com> | |
7 | ||
8 | commit d9771f5ec46c282d518b453c793635dbdc3a2a94 upstream. | |
9 | ||
10 | commit d5d885fd514f ("md: introduce new personality funciton start()") | |
11 | splits the init job to two parts. The first part run() does the jobs that | |
12 | do not require the md threads. The second part start() does the jobs that | |
13 | require the md threads. | |
14 | ||
15 | Now it just does run() in adding new journal device. It needs to do the | |
16 | second part start() too. | |
17 | ||
18 | Fixes: d5d885fd514f ("md: introduce new personality funciton start()") | |
19 | Cc: stable@vger.kernel.org #v4.9+ | |
20 | Reported-by: Michal Soltys <soltys@ziu.info> | |
21 | Signed-off-by: Xiao Ni <xni@redhat.com> | |
22 | Signed-off-by: Song Liu <songliubraving@fb.com> | |
23 | Signed-off-by: Jens Axboe <axboe@kernel.dk> | |
24 | Signed-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) |