OSDN Git Service

md: introduce new personality funciton start()
authorSong Liu <songliubraving@fb.com>
Mon, 20 Nov 2017 06:17:01 +0000 (22:17 -0800)
committerShaohua Li <shli@fb.com>
Mon, 11 Dec 2017 16:52:34 +0000 (08:52 -0800)
commitd5d885fd514fcebc9da5503c88aa0112df7514ef
tree71cf428b0bba2cf5c1afd32b8a32fc3ab5724708
parent50c4c4e268a2d7a3e58ebb698ac74da0de40ae36
md: introduce new personality funciton start()

In do_md_run(), md threads should not wake up until the array is fully
initialized in md_run(). However, in raid5_run(), raid5-cache may wake
up mddev->thread to flush stripes that need to be written back. This
design doesn't break badly right now. But it could lead to bad bug in
the future.

This patch tries to resolve this problem by splitting start up work
into two personality functions, run() and start(). Tasks that do not
require the md threads should go into run(), while task that require
the md threads go into start().

r5l_load_log() is moved to raid5_start(), so it is not called until
the md threads are started in do_md_run().

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/dm-raid.c
drivers/md/md.c
drivers/md/md.h
drivers/md/raid5-cache.c
drivers/md/raid5-log.h
drivers/md/raid5.c