public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Re: pktcdvd oops
@ 2007-11-08  9:08 balagi
  2007-11-08  9:34 ` Tejun Heo
  2007-11-08 17:49 ` Peter Osterlund
  0 siblings, 2 replies; 9+ messages in thread
From: balagi @ 2007-11-08  9:08 UTC (permalink / raw)
  To: Peter Osterlund, Tejun Heo; +Cc: Thomas Maier, Jens Axboe, linux-kernel, gregkh

Hello,

tested it too, running linux 2.6.23 in a qemu instance, and the patch worked.
But i would prefer to take the try_module_get() stuff into pkt_setup_dev() because
it is used also in the older procfs interface. Can we run into the same problem here, means
procfs holds no module references too, like sysfs now?

Maybe also the "/sys/class/pktcdvd/remove" command should be wrapped with an
try_module_get() ???

-Thomas

----- original Nachricht --------

Betreff: Re: pktcdvd oops
Gesendet: Mi 07 Nov 2007 23:07:10 CET
Von: "Peter Osterlund"<petero2@telia.com>

> On Wed, 7 Nov 2007, Tejun Heo wrote:
> 
> > Peter Osterlund wrote:
> >> If the
> >> __module_get() is not safe because the module code could have already
> >> been unloaded, how can it possibly be made safe by adding more code to
> >> the pktcdvd module? If the module is unloaded, trying to execute its
> >> code can't be a good thing no matter what the code does.
> >
> > sysfs itself is now out of module lifespan rules.  sysfs callbacks are
> > guaranteed to stay in memory while running by sysfs node removal waiting
> > for completion of in-flight operations before returning.  In pktcdvd's
> > case, class_destroy() call in pkt_sysfs_cleanup() will wait for all
> > in-flight sysfs r/w ops to complete.
> >
> > So, even while sysfs callbacks are executing, the module beneath can die
> > but it will stay in memory till all the callbacks return.  You need to
> > test module liveness using try_module_get() (and it can fail) if you
> > want to grab module reference from sysfs callbacks.
> 
> Thanks for the explanation.
> 
> Given that explanation, I think the patch is correct and it does fix the 
> BUG on my computer. Can you please push it upstream?
> 
> In any case:
> 
> Acked-by: Peter Osterlund <petero2@telia.com>
> 
> -- 
> Peter Osterlund - petero2@telia.com
> http://web.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/
> 

--- original Nachricht Ende ----










^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <20071105092018.GD5359@kernel.dk>]

end of thread, other threads:[~2007-11-08 17:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08  9:08 Re: pktcdvd oops balagi
2007-11-08  9:34 ` Tejun Heo
2007-11-08 17:49 ` Peter Osterlund
     [not found] <20071105092018.GD5359@kernel.dk>
2007-11-05 22:19 ` Peter Osterlund
2007-11-06  9:06   ` Tejun Heo
2007-11-06 21:07     ` Thomas Maier
2007-11-06 21:42       ` Peter Osterlund
2007-11-07  2:44         ` Tejun Heo
2007-11-07 22:06           ` Peter Osterlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox