Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295474
b: refs/heads/master
c: 4e75732
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman committed Feb 2, 2012
1 parent 64df37a commit 76c8a47
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 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: 60f126d93b210ae708e2a5bb4a3be2121831f2a0
refs/heads/master: 4e75732035d7e97e001bdf6e3149d3967c0221de
24 changes: 12 additions & 12 deletions trunk/fs/proc/proc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,12 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,
if (!p)
goto out;

ret = sysctl_follow_link(&h, &p, current->nsproxy);
err = ERR_PTR(ret);
if (ret)
goto out;
if (S_ISLNK(p->mode)) {
ret = sysctl_follow_link(&h, &p, current->nsproxy);
err = ERR_PTR(ret);
if (ret)
goto out;
}

err = ERR_PTR(-ENOMEM);
inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p);
Expand Down Expand Up @@ -601,10 +603,12 @@ static int proc_sys_link_fill_cache(struct file *filp, void *dirent,
int err, ret = 0;
head = sysctl_head_grab(head);

/* It is not an error if we can not follow the link ignore it */
err = sysctl_follow_link(&head, &table, current->nsproxy);
if (err)
goto out;
if (S_ISLNK(table->mode)) {
/* It is not an error if we can not follow the link ignore it */
err = sysctl_follow_link(&head, &table, current->nsproxy);
if (err)
goto out;
}

ret = proc_sys_fill_cache(filp, dirent, filldir, head, table);
out:
Expand Down Expand Up @@ -950,10 +954,6 @@ static int sysctl_follow_link(struct ctl_table_header **phead,
struct ctl_dir *dir;
int ret;

/* Get out quickly if not a link */
if (!S_ISLNK((*pentry)->mode))
return 0;

ret = 0;
spin_lock(&sysctl_lock);
root = (*pentry)->data;
Expand Down

0 comments on commit 76c8a47

Please sign in to comment.