Thread (14 messages) 14 messages, 5 authors, 2011-05-11

Re: [PATCH V3] fbcon -- fix race between open and removal of

From: Bruno Prémont <bonbons@linux-vserver.org>
Date: 2011-05-11 16:24:00
Also in: lkml

On Wed, 11 May 2011 16:09:29 Tim Gardner wrote:
On 05/10/2011 11:44 PM, Bruno Prémont wrote:
quoted
On Tue, 10 May 2011 Tim Gardner[off-list ref]  wrote:
This only partially protects the list and count as two concurrent
framebuffer registrations do still race against each other.
For the issue addressed by this patch I don't think it makes sense to
have this spinlock at all as it's only used in get_framebuffer_info()
and in put_framebuffer_info() and put_framebuffer_info() doesn't even
look at registered_fb or num_registered_fb.
Such a spinlock makes sense in a separate patch that really protects
all access to registered_fb or num_registered_fb, be it during framebuffer
(un)registration or during access from fbcon.
Our goal was merely to stop the user space open/close races. I agree 
that the framebuffer registration list needs more orthogonal protection, 
but that is going to be a much larger patch.
I know that such a protection needs a much larger patch. (that would be
for 2.6.40 or 2.6.41, I have preparing patches for that cooking)

My main issue for tis patch is that the comment reads as if spinlock was
protecting registered_fb[] and num_registered_fb. So changing the
comment would be a good thing (say it protects fb_info->ref_count).
Later patch can then protect registered_fb against concurrent
framebuffer registrations.

Bruno
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help