Re: [PATCH 2/2] virdevmapper: Deal with unloading dm module

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

 



On Mon, 2020-08-17 at 17:28 +0200, Peter Krempa wrote:
> On Mon, Aug 17, 2020 at 16:26:55 +0200, Michal Privoznik wrote:
> > -    if ((controlFD = virDMOpen()) < 0)
> > +    if ((controlFD = virDMOpen()) < 0) {
> > +        if (controlFD == -2) {
> > +            /* Devmapper was available but now it isn't. Somebody
> > +             * must have removed the module. Reset the major
> > +             * number we remember. */
> > +            virDMMajor = 0;
> 
> This overwrites 'virDMMajor' without taking the mutex. 'unsigned int' on
> x86_64 will be atomic, we shouldn't use a knowingly broken code pattern
> without at least a proper explanation why it's okay.

IIUC you're saying that you'd be okay with adding a comment that
explains why this will work fine on x86_64. If so, I'd like to point
out that libvirt supports many other architectures... Is the same
pattern safe on those as well?

-- 
Andrea Bolognani / Red Hat / Virtualization




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux