# Re: \[dm-devel\] \[PATCH -next v2 2/6\] md: refactor action\_store() for 'idle' and 'frozen'

- From: Xiao Ni \<hidden\>
- Date: 2023-06-13 12:27:06 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2023/06/2231589
- Thread: https://ratatoskr.run/linux-raid/2023/05/2213215/t.md

```text
On Tue, Jun 13, 2023 at 8:00 PM Yu Kuai [ref] wrote:
>
> Hi,
>
> 在 2023/06/13 16:02, Xiao Ni 写道:
> >
> > 在 2023/5/29 下午9:20, Yu Kuai 写道:
> >> From: Yu Kuai <redacted>
> >>
> >> Prepare to handle 'idle' and 'frozen' differently to fix a deadlock,
> >> there
> >> are no functional changes except that MD_RECOVERY_RUNNING is checked
> >> again after 'reconfig_mutex' is held.
> >
> >
> > Can you explain more about why it needs to check MD_RECOVERY_RUNNING
> > again here?
>
> As I explain in the following comment:

Hi

Who can clear the flag before the lock is held?

Regards
Xiao
> >> +    /*
> >> +     * Check again in case MD_RECOVERY_RUNNING is cleared before lock is
> >> +     * held.
> >> +     */
> >> +    if (!test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) {
> >> +        mddev_unlock(mddev);
> >> +        return;
> >> +    }
>
> Thanks,
> Kuai
>

```
