md: unlock mddev before reap sync_thread in action_store
authorGuoqing Jiang <guoqing.jiang@linux.dev>
Tue, 21 Jun 2022 03:11:29 +0000 (11:11 +0800)
committerSong Liu <song@kernel.org>
Sun, 3 Jul 2022 14:55:39 +0000 (07:55 -0700)
commit0c48c3be92add65a95c6dd037292fb1647ba0044
tree01d359604d7c416809e050ed85f836d1b082197d
parent467f738d0e821f36bf6316aaab4ef5bdef9b003e
md: unlock mddev before reap sync_thread in action_store

Since the bug which commit 8b48ec23cc51a ("md: don't unregister sync_thread
with reconfig_mutex held") fixed is related with action_store path, other
callers which reap sync_thread didn't need to be changed.

Let's pull md_unregister_thread from md_reap_sync_thread, then fix previous
bug with belows.

1. unlock mddev before md_reap_sync_thread in action_store.
2. save reshape_position before unlock, then restore it to ensure position
   not changed accidentally by others.

Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/dm-raid.c
drivers/md/md.c