diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-09-09 17:36:37 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-03-24 19:29:53 -0400 |
commit | d8c215adbf3901aa7d00a0f17f08d77be689f838 (patch) | |
tree | 88f7f49abb5944725f3b60d8f28a41580e7f915f /arch/um/drivers/stdio_console.c | |
parent | 43574c1afea4f798592c03cf4d4ecea4fd0a8416 (diff) |
um: convert count_lock to mutex, fix a race in line_open()
If two processes are opening the same line, the second to get
into line_open() will decide that it doesn't need to do anything
(correctly) or wait for anything. The latter, unfortunately,
is incorrect - the first opener might not be through yet. We
need to have exclusion covering the entire line_init(), including
the blocking parts. Moreover, the next patch will need to
widen the exclusion on mconsole side of things, also including
the blocking bits, so let's just convert that sucker to mutex...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers/stdio_console.c')
-rw-r--r-- | arch/um/drivers/stdio_console.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c index 6d244f470968..f8d4325b28b7 100644 --- a/arch/um/drivers/stdio_console.c +++ b/arch/um/drivers/stdio_console.c | |||
@@ -173,7 +173,7 @@ static int stdio_init(void) | |||
173 | vts[i].valid = 1; | 173 | vts[i].valid = 1; |
174 | } | 174 | } |
175 | spin_lock_init(&vts[i].lock); | 175 | spin_lock_init(&vts[i].lock); |
176 | spin_lock_init(&vts[i].count_lock); | 176 | mutex_init(&vts[i].count_lock); |
177 | vts[i].driver = &driver; | 177 | vts[i].driver = &driver; |
178 | } | 178 | } |
179 | console_driver = register_lines(&driver, &console_ops, vts, | 179 | console_driver = register_lines(&driver, &console_ops, vts, |