diff -urN linux-2.6.30-gentoo-r1-orig/fs/proc/base.c linux-2.6.30-gentoo-r1/fs/proc/base.c --- linux-2.6.30-gentoo-r1-orig/fs/proc/base.c 2009-06-10 12:05:27 +0900 +++ linux-2.6.30-gentoo-r1/fs/proc/base.c 2009-06-16 19:23:47 +0900 @@ -1486,7 +1486,7 @@ * due to the way we treat inodes. * * Rewrite the inode's ownerships here because the owning task may have - * performed a setuid(), etc. + * performed a setuid(), etc. Also update file position for FD entries. * * Before the /proc/pid/status file was created the only way to read * the effective uid of a /process was to stat /proc/pid. Reading @@ -1670,13 +1670,16 @@ struct task_struct *task = get_proc_task(inode); int fd = proc_fd(inode); struct files_struct *files; + struct file *file; const struct cred *cred; if (task) { files = get_files_struct(task); if (files) { rcu_read_lock(); - if (fcheck_files(files, fd)) { + file = fcheck_files(files, fd); + if (file) { + inode->i_size = file->f_pos; rcu_read_unlock(); put_files_struct(files); if (task_dumpable(task)) { @@ -1745,7 +1748,7 @@ put_files_struct(files); inode->i_op = &proc_pid_link_inode_operations; - inode->i_size = 64; + inode->i_size = file->f_pos; ei->op.proc_get_link = proc_fd_link; dentry->d_op = &tid_fd_dentry_operations; d_add(dentry, inode);