lkml.org 
[lkml]   [2008]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] Char: vt, make sysfs operations atomic
On 05/27/2008 09:43 PM, Aristeu Rozanski wrote:
>> Hold console sem while creating/destroying sysfs files. Serialisation is
>> so far done by BKL held in tty release_dev and chrdev_open, but no other
>> locks are held in open path.
>>
>> tty->termios->c_iflag |= IUTF8;
>> else
>> tty->termios->c_iflag &= ~IUTF8;
>> - release_console_sem();
>> vcs_make_sysfs(tty);
>> + release_console_sem();
>> return ret;
>> }
>> }
>> @@ -2772,8 +2772,8 @@ static void con_close(struct tty_struct *tty, struct file *filp)
>> if (vc)
>> vc->vc_tty = NULL;
>> tty->driver_data = NULL;
>> - release_console_sem();
>> vcs_remove_sysfs(tty);
>> + release_console_sem();
>> mutex_unlock(&tty_mutex);
>> /*
>> * tty_mutex is released, but we still hold BKL, so there is
> the reason for the code be the way it is is because vcs_{add,remove}_sysfs()
> may sleep

What's the point? To have races in the code but not sleep inside the semaphore?


\
 
 \ /
  Last update: 2008-05-27 22:31    [W:2.738 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site