lkml.org 
[lkml]   [2020]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/8] bdi: add a ->dev_name field to struct backing_dev_info
On Mon 20-04-20 09:48:01, Christoph Hellwig wrote:
> On Sun, Apr 19, 2020 at 06:06:51PM +0200, Christoph Hellwig wrote:
> > > (https://lore.kernel.org/linux-block/20200416071519.807660-4-hch@lst.de/)
> > > and also to the replies to that patch? This is what I found in the replies:
> > > "When driver try to to re-register bdi but without release_bdi(), the old
> > > dev_name will be cover directly by the newer in bdi_register_va(). So, I am
> > > not sure whether it can cause memory leak for bdi->dev_name."
> > >
> > > Has it been considered to avoid that leak by freeing bdi->dev_name from
> > > unregister_bdi(), e.g. as follows?
> >
> > We'd need some protection against concurrent accesses as unregister_bdi
> > can race with them. But with RCU that could be handled, so let me try
> > that.
>
> I looked into it, and while it seems doable I think this goes in the
> wrong direction as it pushed the RCU knowledge into the callers. I'd
> rather get something like this series in ASAP, and then for 5.8 or 5.9
> move the bdi pointer to the gendisk and stop re-registering it and thus
> solve the problems root cause for real.

Yeah, if it could be done it would be a nice solution. Because
re-registering of BDIs is a long-term source of troubles...

Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR

\
 
 \ /
  Last update: 2020-04-20 11:53    [W:0.048 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site