OSDN Git Service

md: reorgnize mddev_create/destroy_serial_pool
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Mon, 23 Dec 2019 09:48:57 +0000 (10:48 +0100)
committerSong Liu <songliubraving@fb.com>
Mon, 13 Jan 2020 19:44:09 +0000 (11:44 -0800)
commitde31ee949739aba9ce7dbb8b10e72c6fce0e76c7
tree8067ef41f74a18c1d2d841d0b82606a629ce11d8
parent3938f5fb82aedbf39792ffee448c61c819e6ab38
md: reorgnize mddev_create/destroy_serial_pool

So far, IO serialization is used for two scenarios:

1. raid1 which enables write-behind mode, and there is rdev in the array
which is multi-queue device and flaged with writemostly.
2. IO serialization is enabled or disabled by change serialize_policy.

So introduce rdev_need_serial to check the first scenario. And for 1, IO
serialization is enabled automatically while 2 is controlled manually.

And it is possible that both scenarios are true, so for create serial pool,
rdev/rdevs_init_serial should be separate from check if the pool existed or
not. Then for destroy pool, we need to check if the pool is needed by other
rdevs due to the first scenario.

Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
drivers/md/md.c