Messages in this thread | | | Date | Tue, 27 May 2008 22:27:26 +0200 | From | Jiri Slaby <> | Subject | Re: [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?
| |