Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310439
b: refs/heads/master
c: 0640113
h: refs/heads/master
i:
  310437: 8250efb
  310435: 37dbbfd
  310431: 466e51a
v: v3
  • Loading branch information
Linus Torvalds committed Jun 4, 2012
1 parent 4626c38 commit 2145577
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5041caa4d5e6dae418963de0c8f8a83f35e35dcf
refs/heads/master: 0640113be25d283e0ff77a9f041e1242182387f0
17 changes: 10 additions & 7 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
rcu_read_lock();
file = fcheck_files(files, fd);
if (file) {
unsigned i_mode, f_mode = file->f_mode;
unsigned f_mode = file->f_mode;

rcu_read_unlock();
put_files_struct(files);
Expand All @@ -1819,12 +1819,14 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
inode->i_gid = GLOBAL_ROOT_GID;
}

i_mode = S_IFLNK;
if (f_mode & FMODE_READ)
i_mode |= S_IRUSR | S_IXUSR;
if (f_mode & FMODE_WRITE)
i_mode |= S_IWUSR | S_IXUSR;
inode->i_mode = i_mode;
if (S_ISLNK(inode->i_mode)) {
unsigned i_mode = S_IFLNK;
if (f_mode & FMODE_READ)
i_mode |= S_IRUSR | S_IXUSR;
if (f_mode & FMODE_WRITE)
i_mode |= S_IWUSR | S_IXUSR;
inode->i_mode = i_mode;
}

security_task_to_inode(task, inode);
put_task_struct(task);
Expand Down Expand Up @@ -1859,6 +1861,7 @@ static struct dentry *proc_fd_instantiate(struct inode *dir,
ei = PROC_I(inode);
ei->fd = fd;

inode->i_mode = S_IFLNK;
inode->i_op = &proc_pid_link_inode_operations;
inode->i_size = 64;
ei->op.proc_get_link = proc_fd_link;
Expand Down

0 comments on commit 2145577

Please sign in to comment.