summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Ni <xni@redhat.com>2019-06-15 01:41:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-26 10:12:59 +0300
commit70ec79cec535c76c717618b1a603a91167966889 (patch)
tree465f973153c940674965ab9e5d6fb9f052525570
parente36f752d0c0ecd6ea70fd7129d2f8b7dd521b372 (diff)
downloadlinux-70ec79cec535c76c717618b1a603a91167966889.tar.xz
raid5-cache: Need to do start() part job after adding journal device
commit d9771f5ec46c282d518b453c793635dbdc3a2a94 upstream. commit d5d885fd514f ("md: introduce new personality funciton start()") splits the init job to two parts. The first part run() does the jobs that do not require the md threads. The second part start() does the jobs that require the md threads. Now it just does run() in adding new journal device. It needs to do the second part start() too. Fixes: d5d885fd514f ("md: introduce new personality funciton start()") Cc: stable@vger.kernel.org #v4.9+ Reported-by: Michal Soltys <soltys@ziu.info> Signed-off-by: Xiao Ni <xni@redhat.com> Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/md/raid5.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index a4d2f552c8ab..05e288cba143 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7674,7 +7674,7 @@ abort:
static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
{
struct r5conf *conf = mddev->private;
- int err = -EEXIST;
+ int ret, err = -EEXIST;
int disk;
struct disk_info *p;
int first = 0;
@@ -7689,7 +7689,14 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev)
* The array is in readonly mode if journal is missing, so no
* write requests running. We should be safe
*/
- log_init(conf, rdev, false);
+ ret = log_init(conf, rdev, false);
+ if (ret)
+ return ret;
+
+ ret = r5l_start(conf->log);
+ if (ret)
+ return ret;
+
return 0;
}
if (mddev->recovery_disabled == conf->recovery_disabled)