]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "md: don't unregister sync_thread with reconfig_mutex held"
authorGuoqing Jiang <guoqing.jiang@linux.dev>
Tue, 7 Jun 2022 02:03:56 +0000 (10:03 +0800)
committerSong Liu <song@kernel.org>
Wed, 15 Jun 2022 17:30:14 +0000 (10:30 -0700)
commit183a551f8700a5d81789ef2a54254796090cc340
treea58c4d265e326635df5421d724c1d27690fdc77c
parent88ad403b64602104d6f666c2098996f7513b664b
Revert "md: don't unregister sync_thread with reconfig_mutex held"

The 07reshape5intr test is broke because of below path.

    md_reap_sync_thread
            -> mddev_unlock
            -> md_unregister_thread(&mddev->sync_thread)

And md_check_recovery is triggered by,

mddev_unlock -> md_wakeup_thread(mddev->thread)

then mddev->reshape_position is set to MaxSector in raid5_finish_reshape
since MD_RECOVERY_INTR is cleared in md_check_recovery, which means
feature_map is not set with MD_FEATURE_RESHAPE_ACTIVE and superblock's
reshape_position can't be updated accordingly.

Fixes: d0d1827b64334 ("md: don't unregister sync_thread with reconfig_mutex held")
Reported-by: Logan Gunthorpe <logang@deltatee.com>
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
drivers/md/md.h