lkml.org 
[lkml]   [2012]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mce: fix warning messages about static struct mce_device

* Alan Stern <stern@rowland.harvard.edu> wrote:

> Or to put it another way, even though no code takes references
> to these device structures (can you really guarantee that even
> now?), [...]

That's a good question. Do these devices get exposed to
user-space access via sysfs somehow, where such an extra
reference could materialize?

> [...] how do you prevent references being taken in future
> versions of the kernel? Calling memset while there still are
> outstanding references very definitely _is_ a bug.

Unless there's a reference i missed the 'refcounting' here is
very simple and does not exist at all.

IMHO you should not impose complexity and abstraction on code
just because. Now i don't care much about the extra pointer, but
the [NR_CPUS] array was doubly ugly (and Greg promised to fix
that, so no problems from me).

So the conclusion is that the reasons stated here don't really
apply. The one i mentioned *does* apply: the original bug was
due to sloppy life time rules of this driver buffer, and that
came back to bite us. Making it dynamic solves that kind of
problem. In that sense the warning is fine too.

Thanks,

Ingo


\
 
 \ /
  Last update: 2012-01-19 20:41    [W:0.107 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site