Re: 2.6.36: Sound stop working

From: Linus Torvalds
Date: Thu Aug 12 2010 - 17:51:19 EST


On Thu, Aug 12, 2010 at 2:41 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> Al, what was the problem that caused you to think that we want to have
> a 'struct file' here? Is it just the fact that some of those fsnotify
> things use that 'path' structure that is embedded in the parent? But
> isn't the simplest fix for that to just _copy_ the "struct path"
> rather than pass the "struct file" around?

Btw, that's exactly what the fsnotify code does seem to do, in
fsnotify_create_event(). So as far as I can tell, it's all ok - we
only use that file->f_path pointer while we hold the file open, and
then we copy it to event->path and increment the counts properly.

Of course, maybe I'm missing some other case where we _don't_ copy the
data, and pass a pointer to a file->f_path around that could get
stale. Or maybe I'm missing some other worry entirely.

But those games with f_count are just disgusting. The path-based thing
seems to be much more straightforward.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/