Re: [PATCH] libmpathpersist: fix thread safety of default functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2021-01-25 at 23:31 -0600, Benjamin Marzinski wrote:
> commit a839e39e ("libmpathpersist: factor out initialization and
> teardown") made mpath_presistent_reserve_{in,out} use share variables
> for curmp and pathvec.  There are users of this library that call
> these
> functions in a multi-threaded process, and this change causes their
> application to crash. config and udev are also shared variables, but
> libmpathpersist doesn't write to the config in
> mpath_presistent_reserve_{in,out}, and looking into the libudev code,
> I
> don't see any place where libmpathpersist uses the udev object in a
> way
> that isn't thread-safe.
> 
> This patch makes mpath_presistent_reserve_{in,out} go back to using
> local variables for curmp and pathvec, so that multiple threads won't
> be operating on these variables at the same time.
> 
> Fixes: a839e39e ("libmpathpersist: factor out initialization and
> teardown")
> Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>

It turns out our CI has caught an actual bug for the first time :-)

https://github.com/openSUSE/multipath-tools/runs/1768201417?check_suite_focus=true#step:8:719

No need to resubmit, I'll just quickly amend this.

Regards
Martin


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux