X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fproc%2Fbase.c;h=1427f0158104720cb12f6fc5b95cb0d1538ee7d2;hb=70790a4b5cd6c0291e5b1a2836e2832d46036ac6;hp=9db204e9fbfcfb632b5d5fa80d685104556e93b7;hpb=413ba3004a4036bb5d6e52d2faa2b19cb13561dc;p=linux-2.6.git diff --git a/fs/proc/base.c b/fs/proc/base.c index 9db204e9f..1427f0158 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1510,7 +1510,8 @@ static struct inode_operations proc_tid_attr_inode_operations = { /* * /proc/self: */ -static int proc_self_readlink(struct dentry *dentry, char *buffer, int buflen) +static int proc_self_readlink(struct dentry *dentry, char __user *buffer, + int buflen) { char tmp[30]; sprintf(tmp, "%d", current->tgid); @@ -1572,6 +1573,7 @@ struct dentry *proc_pid_unhash(struct task_struct *p) void proc_pid_flush(struct dentry *proc_dentry) { + might_sleep(); if(proc_dentry != NULL) { shrink_dcache_parent(proc_dentry); dput(proc_dentry); @@ -1803,7 +1805,9 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir) ino_t ino = fake_ino(tgid,PROC_TGID_INO); unsigned long j = PROC_NUMBUF; - do buf[--j] = '0' + (tgid % 10); while (tgid/=10); + do + buf[--j] = '0' + (tgid % 10); + while ((tgid /= 10) != 0); if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino, DT_DIR) < 0) { filp->f_version = tgid; @@ -1858,7 +1862,7 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi do buf[--j] = '0' + (tid % 10); - while (tid /= 10); + while ((tid /= 10) != 0); if (filldir(dirent, buf+j, PROC_NUMBUF-j, pos, ino, DT_DIR) < 0) break;