[dm-devel] [PATCH v2] dm mpath: fix race condition between multipath_dtr and pg_init_done
Junichi Nomura
j-nomura at ce.jp.nec.com
Fri Nov 1 01:10:51 UTC 2013
On 10/31/13 23:48, Mike Snitzer wrote:
> On Thu, Oct 31 2013 at 5:03am -0400,
> Junichi Nomura <j-nomura at ce.jp.nec.com> wrote:
>> how about moving this to flush_multipath_work(), which is supposed
>> to silence background activities?
>> I.e.
>> flush_multipath_work() {
>> <disable pg_init retry>
>> ...
>> <enable pg_init retry>
>> }
>>
>> Then it not only fixes the crash you hit, it also fixes the hidden bug
>> that pg_init continues retrying while the device is suspended.
>
> I ran with your suggestion. Please see below.
>
> To be clear, pg_init isn't disabled while mpath device is suspended
> (meaning m->pg_init_disabled isn't set until the device is resumed).
> But flush_multipath_work() will no longer start pg_init during suspend
> -- which could otherwise occur while the mpath device is suspended. So
> in practice it accomplishes the stated goal.
>
> Thanks for the suggestion Junichi. Are you OK with this? If so please
> provide your Ack.
Yes, that's perfect. Thank you.
Acked-by: Junichi Nomura <j-nomura at ce.jp.nec.com>
And thanks Shiva Krishna for finding/fixing this.
>
> Shiva, can you please verify that this patch resolves the race, should
> accomplish the same: just pushes the disabling of pg_init inside
> flush_multipath_work().
--
Jun'ichi Nomura, NEC Corporation
More information about the dm-devel
mailing list