diff -NurpP --minimal a/kernel/vserver/proc.c b/kernel/vserver/proc.c --- a/kernel/vserver/proc.c 2005-03-01 00:07:27.000000000 +0100 +++ b/kernel/vserver/proc.c 2005-03-01 01:02:45.000000000 +0100 @@ -293,7 +293,6 @@ static ssize_t proc_vid_info_read(struct struct inode * inode = file->f_dentry->d_inode; unsigned long page; ssize_t length; - ssize_t end; int vid; if (count > PROC_BLOCK_SIZE) @@ -304,22 +303,12 @@ static ssize_t proc_vid_info_read(struct vid = inode_vid(inode); length = PROC_I(inode)->op.proc_vid_read(vid, (char*)page); - if (length < 0) { - free_page(page); - return length; - } - /* Static 4kB (or whatever) block capacity */ - if (*ppos >= length) { - free_page(page); - return 0; - } - if (count + *ppos > length) - count = length - *ppos; - end = count + *ppos; - copy_to_user(buf, (char *) page + *ppos, count); - *ppos = end; + if (length >= 0) + length = simple_read_from_buffer(buf, count, ppos, + (char *)page, length); + free_page(page); - return count; + return length; }