[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <483C6EAE.4050401@gmail.com>
Date: Tue, 27 May 2008 22:27:26 +0200
From: Jiri Slaby <jirislaby@...il.com>
To: Aristeu Rozanski <aris@...vo.org>
CC: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Alan Cox <alan@...rguk.ukuu.org.uk>
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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists