[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <42cc372e0ada4267bdf4038a0202d95d@EX13D32EUC003.ant.amazon.com>
Date: Fri, 29 Nov 2019 16:08:56 +0000
From: "Durrant, Paul" <pdurrant@...zon.com>
To: Jan Beulich <jbeulich@...e.com>
CC: "xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Stefano Stabellini" <sstabellini@...nel.org>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Juergen Gross <jgross@...e.com>
Subject: RE: [PATCH v2 1/2] xen/xenbus: reference count registered modules
> -----Original Message-----
> From: Jan Beulich <jbeulich@...e.com>
> Sent: 29 November 2019 16:01
> To: Durrant, Paul <pdurrant@...zon.com>
> Cc: xen-devel@...ts.xenproject.org; linux-block@...r.kernel.org; linux-
> kernel@...r.kernel.org; Stefano Stabellini <sstabellini@...nel.org>; Boris
> Ostrovsky <boris.ostrovsky@...cle.com>; Juergen Gross <jgross@...e.com>
> Subject: Re: [PATCH v2 1/2] xen/xenbus: reference count registered modules
>
> On 29.11.2019 14:43, Paul Durrant wrote:
> > To prevent a module being removed whilst attached to a frontend, and
>
> Why only frontend?
>
True. Originally this was only intended for backends, but I guess this should now be 'otherend' or some equivalent form of words.
> > hence xenbus calling into potentially invalid text, take a reference on
> > the module before calling the probe() method (dropping it if
> unsuccessful)
> > and drop the reference after returning from the remove() method.
> >
> > NOTE: This allows the ad-hoc reference counting in xen-netback to be
> > removed. This will be done in a subsequent patch.
> >
> > Suggested-by: Jan Beulich <jbeulich@...e.com>
> > Signed-off-by: Paul Durrant <pdurrant@...zon.com>
> >
> > --- a/drivers/xen/xenbus/xenbus_probe.c
> > +++ b/drivers/xen/xenbus/xenbus_probe.c
> > @@ -232,9 +232,11 @@ int xenbus_dev_probe(struct device *_dev)
> > return err;
> > }
> >
> > + __module_get(drv->driver.owner);
>
> I guess you really want try_module_get() and deal with it returning
> false.
>
Perhaps, yes.
Paul
> Jan
Powered by blists - more mailing lists