From: Yu Kuai <yukuai3@xxxxxxxxxx> Changes in v2: - rebase for md-next; - update commit message for patch 3; This is the 4th patchset to do some preparatory work to synchronize io with array reconfiguration. 1) The first patchset refactor 'active_io', make sure that mddev_suspend() will wait for io to be done. [1] 2) The second patchset remove 'quiesce' callback from mddev_suspend(), so that mddev_suspend() doesn't rely on 'quiesce' callback is registered, and can be used for all personalites; [2] 3) Make array reconfiguration independent from daemon thread, and synchronize it with io will be much easier because io may rely on daemon thread to be done. 4) This patchset move initialization of 'active_io' from md_run() to md_alloc(), so that mddev_suspend() won't rely on holding 'reconfig_mutex' to check if 'mddev->pers' is set, and it can be called at any time after mddev is allocated.(Done by patch 1, and other patches are cleanup) Yu Kuai (7): md: initialize 'active_io' while allocating mddev md: initialize 'writes_pending' while allocating mddev md: don't rely on 'mddev->pers' to be set in mddev_suspend() md-bitmap: remove the checking of 'pers->quiesce' from location_store() md-bitmap: suspend array earlier in location_store() md: don't check 'mddev->pers' from suspend_hi_store() md: don't check 'mddev->pers' and 'pers->quiesce' from suspend_lo_store() [1] https://lore.kernel.org/all/20230621165110.1498313-1-yukuai1@xxxxxxxxxxxxxxx/ [2] https://lore.kernel.org/all/20230628012931.88911-2-yukuai1@xxxxxxxxxxxxxxx/ Yu Kuai (7): md: initialize 'active_io' while allocating mddev md: initialize 'writes_pending' while allocating mddev md: don't rely on 'mddev->pers' to be set in mddev_suspend() md-bitmap: remove the checking of 'pers->quiesce' from location_store() md-bitmap: suspend array earlier in location_store() md: don't check 'mddev->pers' from suspend_hi_store() md: don't check 'mddev->pers' and 'pers->quiesce' from suspend_lo_store() drivers/md/dm-raid.c | 7 ++- drivers/md/md-bitmap.c | 47 +++++++++---------- drivers/md/md.c | 100 ++++++++++++++++++++--------------------- drivers/md/md.h | 4 +- drivers/md/raid1.c | 3 +- drivers/md/raid10.c | 3 -- drivers/md/raid5.c | 3 -- 7 files changed, 78 insertions(+), 89 deletions(-) -- 2.39.2