md: Don't clear MD_CLOSING until mddev is freed
authorXiao Ni <xni@redhat.com>
Wed, 11 Jun 2025 07:31:07 +0000 (15:31 +0800)
committerYu Kuai <yukuai3@huawei.com>
Sat, 12 Jul 2025 09:51:59 +0000 (17:51 +0800)
commit5f286f33553d600e6c2fb5a23dd6afcf99b3ebac
tree129e8b6ed79fc740ca1a38eb2a5f22720a7c71b5
parent9e59d609763f70a992a8f3808dabcce60f14eb5c
md: Don't clear MD_CLOSING until mddev is freed

UNTIL_STOP is used to avoid mddev is freed on the last close before adding
disks to mddev. And it should be cleared when stopping an array which is
mentioned in commit efeb53c0e572 ("md: Allow md devices to be created by
name."). So reset ->hold_active to 0 in md_clean.

And MD_CLOSING should be kept until mddev is freed to avoid reopen.

Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Xiao Ni <xni@redhat.com>
Link: https://lore.kernel.org/linux-raid/20250611073108.25463-3-xni@redhat.com
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
drivers/md/md.c