lkml.org 
[lkml]   [2004]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] CDRW packet writing support for 2.6.7-bk13
From
Date
Andrew Morton <akpm@osdl.org> writes:

> Greg KH <greg@kroah.com> wrote:
> >
> > > const char *__bdevname(dev_t dev, char *buffer)
> > > {
> > > struct gendisk *disk;
> > > int part;
> > >
> > > disk = get_gendisk(dev, &part);
> > > if (disk) {
> > > buffer = disk_name(disk, part, buffer);
> > > put_disk(disk);
> > > } else {
> > > snprintf(buffer, BDEVNAME_SIZE, "unknown-block(%u,%u)",
> > > MAJOR(dev), MINOR(dev));
> > > }
> > >
> > > get_gendisk() did an internal module_get() in kobj_lookup().
> >
> > But if kobj_lookup() succeeds, module_put() is called before returning
> > (actually it's always called, right?)

But kobj_lookup() also calls probe(), which equals ata_probe() in the
IDE case, and ata_probe() calls get_disk() which calls
try_module_get() to acquire another reference to the module. I guess
all probe() functions behave the same way, as I've seen the same
problem with the sr_mod module.

> Oop, sorry, yes. Peter, are you sure this is where the leak is coming from?

I'm sure that the module reference count as reported by lsmod
increases each time I access /proc/driver/pktcdvd/pktcdvd0. I can make
this problem go away either by patching __bdevname() or by deleting
the call to __bdevname() in pktcdvd.c.

--
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.058 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site