Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311143
b: refs/heads/master
c: 4a77a5a
h: refs/heads/master
i:
  311141: 7a9cdfd
  311139: b3c2d6a
  311135: 058752c
v: v3
  • Loading branch information
Yuanhan Liu authored and Greg Kroah-Hartman committed Jun 16, 2012
1 parent 3cf3c27 commit 0890379
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2ae715d66bf4becfb85eb84b7150e23cf27df30
refs/heads/master: 4a77a5a06ec66ed05199b301e7c25f42f979afdc
13 changes: 11 additions & 2 deletions trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf,
if (!user)
return -EBADF;

mutex_lock(&user->lock);
ret = mutex_lock_interruptible(&user->lock);
if (ret)
return ret;
raw_spin_lock(&logbuf_lock);
while (user->seq == log_next_seq) {
if (file->f_flags & O_NONBLOCK) {
Expand Down Expand Up @@ -976,6 +978,7 @@ int do_syslog(int type, char __user *buf, int len, bool from_file)
{
bool clear = false;
static int saved_console_loglevel = -1;
static DEFINE_MUTEX(syslog_mutex);
int error;

error = check_syslog_permissions(type, from_file);
Expand All @@ -1002,11 +1005,17 @@ int do_syslog(int type, char __user *buf, int len, bool from_file)
error = -EFAULT;
goto out;
}
error = mutex_lock_interruptible(&syslog_mutex);
if (error)
goto out;
error = wait_event_interruptible(log_wait,
syslog_seq != log_next_seq);
if (error)
if (error) {
mutex_unlock(&syslog_mutex);
goto out;
}
error = syslog_print(buf, len);
mutex_unlock(&syslog_mutex);
break;
/* Read/clear last kernel messages */
case SYSLOG_ACTION_READ_CLEAR:
Expand Down

0 comments on commit 0890379

Please sign in to comment.