[dm-devel] [PATCH v2] dm mpath: fix race condition between multipath_dtr and pg_init_done

Merla, ShivaKrishna ShivaKrishna.Merla at netapp.com
Thu Oct 31 15:26:48 UTC 2013


> -----Original Message-----
> From: Mike Snitzer [mailto:snitzer at redhat.com]
> Sent: Thursday, October 31, 2013 9:48 AM
> To: Junichi Nomura; Merla, ShivaKrishna
> Cc: device-mapper development; agk at redhat.com
> Subject: [PATCH v2] dm mpath: fix race condition between multipath_dtr
> and pg_init_done
> 
> On Thu, Oct 31 2013 at  5:03am -0400,
> Junichi Nomura <j-nomura at ce.jp.nec.com> wrote:
> 
> >
> > Hi,
> >
> > 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.
> 
> 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().

Yes Mike, This looks good. Thanks Junichi for the suggestion.




More information about the dm-devel mailing list