Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235521
b: refs/heads/master
c: dc1892c
h: refs/heads/master
i:
  235519: eacc397
v: v3
  • Loading branch information
Jiri Olsa authored and Greg Kroah-Hartman committed Feb 17, 2011
1 parent 1cf7a42 commit 6e926f7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ffdda950394b6da54d68e9643bc691ebad7a6cc
refs/heads/master: dc1892c4bc6960121ca4c8023a07c815cfd689be
18 changes: 18 additions & 0 deletions trunk/drivers/tty/vt/vc_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6e926f7

Please sign in to comment.