All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Aristeu Rozanski <aris@ruivo.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH 1/1] Char: vt, make sysfs operations atomic
Date: Tue, 27 May 2008 22:27:26 +0200	[thread overview]
Message-ID: <483C6EAE.4050401@gmail.com> (raw)
In-Reply-To: <20080527194357.GA12185@cathedrallabs.org>

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?

  reply	other threads:[~2008-05-27 20:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-26 11:53 [PATCH 1/1] Char: vt, make sysfs operations atomic Jiri Slaby
2008-05-26 11:58 ` Alan Cox
2008-05-27 19:43 ` Aristeu Rozanski
2008-05-27 20:27   ` Jiri Slaby [this message]
2008-05-27 20:48     ` Aristeu Rozanski
2008-05-28 22:57       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=483C6EAE.4050401@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=aris@ruivo.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.