Commit 24b10ca2 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] misc fixes

1) proc/<pid>/fd readdir() has broken locking - sometimes it ends up with
task->files->file_lock locked.

2) missing variable definition in arch/s390x/kernel/linux32.c::cp_new_stat32().

Please, apply - the first one is really serious.
parent 6441b29e
...@@ -1473,7 +1473,9 @@ asmlinkage int sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, u32 tvp_x) ...@@ -1473,7 +1473,9 @@ asmlinkage int sys32_select(int n, u32 *inp, u32 *outp, u32 *exp, u32 tvp_x)
static int cp_new_stat32(struct kstat *stat, struct stat32 *statbuf) static int cp_new_stat32(struct kstat *stat, struct stat32 *statbuf)
{ {
err = put_user(stat->dev, &statbuf->st_dev); int err;
err = put_user(stat->dev, &statbuf->st_dev);
err |= put_user(stat->ino, &statbuf->st_ino); err |= put_user(stat->ino, &statbuf->st_ino);
err |= put_user(stat->mode, &statbuf->st_mode); err |= put_user(stat->mode, &statbuf->st_mode);
err |= put_user(stat->nlink, &statbuf->st_nlink); err |= put_user(stat->nlink, &statbuf->st_nlink);
......
...@@ -623,8 +623,10 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir) ...@@ -623,8 +623,10 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
} while (i); } while (i);
ino = fake_ino(pid, PROC_PID_FD_DIR + fd); ino = fake_ino(pid, PROC_PID_FD_DIR + fd);
if (filldir(dirent, buf+j, NUMBUF-j, fd+2, ino, DT_LNK) < 0) if (filldir(dirent, buf+j, NUMBUF-j, fd+2, ino, DT_LNK) < 0) {
read_lock(&files->file_lock);
break; break;
}
read_lock(&files->file_lock); read_lock(&files->file_lock);
} }
read_unlock(&files->file_lock); read_unlock(&files->file_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment