Commit be626ff7 authored by Yu Kuai's avatar Yu Kuai Committed by Zheng Zengkai
Browse files

md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly()

stable inclusion
from stable-v6.6.7
commit 49b79af00d24e5b27049725aa3bc11f4175c3c2c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8SSQ4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=49b79af00d24e5b27049725aa3bc11f4175c3c2c



--------------------------------

[ Upstream commit c9f7cb5b2bc968adcdc686c197ed108f47fd8eb0 ]

If md_set_readonly() failed, the array could still be read-write, however
'MD_RECOVERY_FROZEN' could still be set, which leave the array in an
abnormal state that sync or recovery can't continue anymore.
Hence make sure the flag is cleared after md_set_readonly() returns.

Fixes: 88724bfa ("md: wait for pending superblock updates before switching to read-only")
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Acked-by: default avatarXiao Ni <xni@redhat.com>
Signed-off-by: default avatarSong Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231205094215.1824240-3-yukuai1@huaweicloud.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 9c76a0b2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment