diff --git a/[refs] b/[refs] index d3ab99bf531c..53fbd8569963 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1ffdda950394b6da54d68e9643bc691ebad7a6cc +refs/heads/master: dc1892c4bc6960121ca4c8023a07c815cfd689be diff --git a/trunk/drivers/tty/vt/vc_screen.c b/trunk/drivers/tty/vt/vc_screen.c index a672ed192d33..3c27c4bc6040 100644 --- a/trunk/drivers/tty/vt/vc_screen.c +++ b/trunk/drivers/tty/vt/vc_screen.c @@ -159,7 +159,13 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig) int size; mutex_lock(&con_buf_mtx); + console_lock(); size = vcs_size(file->f_path.dentry->d_inode); + console_unlock(); + if (size < 0) { + mutex_unlock(&con_buf_mtx); + return size; + } switch (orig) { default: mutex_unlock(&con_buf_mtx); @@ -237,6 +243,12 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) * could sleep. */ size = vcs_size(inode); + if (size < 0) { + if (read) + break; + ret = size; + goto unlock_out; + } if (pos >= size) break; if (count > size - pos) @@ -436,6 +448,12 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) * Return data written up to now on failure. */ size = vcs_size(inode); + if (size < 0) { + if (written) + break; + ret = size; + goto unlock_out; + } if (pos >= size) break; if (this_round > size - pos)