diff options
Diffstat (limited to 'fs/proc')
| -rw-r--r-- | fs/proc/array.c | 3 | ||||
| -rw-r--r-- | fs/proc/base.c | 30 | ||||
| -rw-r--r-- | fs/proc/consoles.c | 4 | ||||
| -rw-r--r-- | fs/proc/inode.c | 8 | ||||
| -rw-r--r-- | fs/proc/proc_devtree.c | 2 | ||||
| -rw-r--r-- | fs/proc/proc_sysctl.c | 8 |
6 files changed, 14 insertions, 41 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index df2b703b9d0f..7c99c1cf7e5c 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
| @@ -353,9 +353,6 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, | |||
| 353 | task_cap(m, task); | 353 | task_cap(m, task); |
| 354 | task_cpus_allowed(m, task); | 354 | task_cpus_allowed(m, task); |
| 355 | cpuset_task_status_allowed(m, task); | 355 | cpuset_task_status_allowed(m, task); |
| 356 | #if defined(CONFIG_S390) | ||
| 357 | task_show_regs(m, task); | ||
| 358 | #endif | ||
| 359 | task_context_switch_counts(m, task); | 356 | task_context_switch_counts(m, task); |
| 360 | return 0; | 357 | return 0; |
| 361 | } | 358 | } |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 9d096e82b201..d49c4b5d2c3e 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -2620,35 +2620,6 @@ static const struct pid_entry proc_base_stuff[] = { | |||
| 2620 | &proc_self_inode_operations, NULL, {}), | 2620 | &proc_self_inode_operations, NULL, {}), |
| 2621 | }; | 2621 | }; |
| 2622 | 2622 | ||
| 2623 | /* | ||
| 2624 | * Exceptional case: normally we are not allowed to unhash a busy | ||
| 2625 | * directory. In this case, however, we can do it - no aliasing problems | ||
| 2626 | * due to the way we treat inodes. | ||
| 2627 | */ | ||
| 2628 | static int proc_base_revalidate(struct dentry *dentry, struct nameidata *nd) | ||
| 2629 | { | ||
| 2630 | struct inode *inode; | ||
| 2631 | struct task_struct *task; | ||
| 2632 | |||
| 2633 | if (nd->flags & LOOKUP_RCU) | ||
| 2634 | return -ECHILD; | ||
| 2635 | |||
| 2636 | inode = dentry->d_inode; | ||
| 2637 | task = get_proc_task(inode); | ||
| 2638 | if (task) { | ||
| 2639 | put_task_struct(task); | ||
| 2640 | return 1; | ||
| 2641 | } | ||
| 2642 | d_drop(dentry); | ||
| 2643 | return 0; | ||
| 2644 | } | ||
| 2645 | |||
| 2646 | static const struct dentry_operations proc_base_dentry_operations = | ||
| 2647 | { | ||
| 2648 | .d_revalidate = proc_base_revalidate, | ||
| 2649 | .d_delete = pid_delete_dentry, | ||
| 2650 | }; | ||
| 2651 | |||
| 2652 | static struct dentry *proc_base_instantiate(struct inode *dir, | 2623 | static struct dentry *proc_base_instantiate(struct inode *dir, |
| 2653 | struct dentry *dentry, struct task_struct *task, const void *ptr) | 2624 | struct dentry *dentry, struct task_struct *task, const void *ptr) |
| 2654 | { | 2625 | { |
| @@ -2685,7 +2656,6 @@ static struct dentry *proc_base_instantiate(struct inode *dir, | |||
| 2685 | if (p->fop) | 2656 | if (p->fop) |
| 2686 | inode->i_fop = p->fop; | 2657 | inode->i_fop = p->fop; |
| 2687 | ei->op = p->op; | 2658 | ei->op = p->op; |
| 2688 | d_set_d_op(dentry, &proc_base_dentry_operations); | ||
| 2689 | d_add(dentry, inode); | 2659 | d_add(dentry, inode); |
| 2690 | error = NULL; | 2660 | error = NULL; |
| 2691 | out: | 2661 | out: |
diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c index eafc22ab1fdd..b701eaa482bf 100644 --- a/fs/proc/consoles.c +++ b/fs/proc/consoles.c | |||
| @@ -67,7 +67,7 @@ static void *c_start(struct seq_file *m, loff_t *pos) | |||
| 67 | struct console *con; | 67 | struct console *con; |
| 68 | loff_t off = 0; | 68 | loff_t off = 0; |
| 69 | 69 | ||
| 70 | acquire_console_sem(); | 70 | console_lock(); |
| 71 | for_each_console(con) | 71 | for_each_console(con) |
| 72 | if (off++ == *pos) | 72 | if (off++ == *pos) |
| 73 | break; | 73 | break; |
| @@ -84,7 +84,7 @@ static void *c_next(struct seq_file *m, void *v, loff_t *pos) | |||
| 84 | 84 | ||
| 85 | static void c_stop(struct seq_file *m, void *v) | 85 | static void c_stop(struct seq_file *m, void *v) |
| 86 | { | 86 | { |
| 87 | release_console_sem(); | 87 | console_unlock(); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | static const struct seq_operations consoles_op = { | 90 | static const struct seq_operations consoles_op = { |
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 176ce4cda68a..d6a7ca1fdac5 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | static void proc_evict_inode(struct inode *inode) | 27 | static void proc_evict_inode(struct inode *inode) |
| 28 | { | 28 | { |
| 29 | struct proc_dir_entry *de; | 29 | struct proc_dir_entry *de; |
| 30 | struct ctl_table_header *head; | ||
| 30 | 31 | ||
| 31 | truncate_inode_pages(&inode->i_data, 0); | 32 | truncate_inode_pages(&inode->i_data, 0); |
| 32 | end_writeback(inode); | 33 | end_writeback(inode); |
| @@ -38,8 +39,11 @@ static void proc_evict_inode(struct inode *inode) | |||
| 38 | de = PROC_I(inode)->pde; | 39 | de = PROC_I(inode)->pde; |
| 39 | if (de) | 40 | if (de) |
| 40 | pde_put(de); | 41 | pde_put(de); |
| 41 | if (PROC_I(inode)->sysctl) | 42 | head = PROC_I(inode)->sysctl; |
| 42 | sysctl_head_put(PROC_I(inode)->sysctl); | 43 | if (head) { |
| 44 | rcu_assign_pointer(PROC_I(inode)->sysctl, NULL); | ||
| 45 | sysctl_head_put(head); | ||
| 46 | } | ||
| 43 | } | 47 | } |
| 44 | 48 | ||
| 45 | struct vfsmount *proc_mnt; | 49 | struct vfsmount *proc_mnt; |
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c index d9396a4fc7ff..927cbd115e53 100644 --- a/fs/proc/proc_devtree.c +++ b/fs/proc/proc_devtree.c | |||
| @@ -233,7 +233,7 @@ void __init proc_device_tree_init(void) | |||
| 233 | return; | 233 | return; |
| 234 | root = of_find_node_by_path("/"); | 234 | root = of_find_node_by_path("/"); |
| 235 | if (root == NULL) { | 235 | if (root == NULL) { |
| 236 | printk(KERN_ERR "/proc/device-tree: can't find root\n"); | 236 | pr_debug("/proc/device-tree: can't find root\n"); |
| 237 | return; | 237 | return; |
| 238 | } | 238 | } |
| 239 | proc_device_tree_add_node(root, proc_device_tree); | 239 | proc_device_tree_add_node(root, proc_device_tree); |
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 09a1f92a34ef..f50133c11c24 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
| @@ -32,7 +32,6 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, | |||
| 32 | ei->sysctl_entry = table; | 32 | ei->sysctl_entry = table; |
| 33 | 33 | ||
| 34 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 34 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
| 35 | inode->i_flags |= S_PRIVATE; /* tell selinux to ignore this inode */ | ||
| 36 | inode->i_mode = table->mode; | 35 | inode->i_mode = table->mode; |
| 37 | if (!table->child) { | 36 | if (!table->child) { |
| 38 | inode->i_mode |= S_IFREG; | 37 | inode->i_mode |= S_IFREG; |
| @@ -408,15 +407,18 @@ static int proc_sys_compare(const struct dentry *parent, | |||
| 408 | const struct dentry *dentry, const struct inode *inode, | 407 | const struct dentry *dentry, const struct inode *inode, |
| 409 | unsigned int len, const char *str, const struct qstr *name) | 408 | unsigned int len, const char *str, const struct qstr *name) |
| 410 | { | 409 | { |
| 410 | struct ctl_table_header *head; | ||
| 411 | /* Although proc doesn't have negative dentries, rcu-walk means | 411 | /* Although proc doesn't have negative dentries, rcu-walk means |
| 412 | * that inode here can be NULL */ | 412 | * that inode here can be NULL */ |
| 413 | /* AV: can it, indeed? */ | ||
| 413 | if (!inode) | 414 | if (!inode) |
| 414 | return 0; | 415 | return 1; |
| 415 | if (name->len != len) | 416 | if (name->len != len) |
| 416 | return 1; | 417 | return 1; |
| 417 | if (memcmp(name->name, str, len)) | 418 | if (memcmp(name->name, str, len)) |
| 418 | return 1; | 419 | return 1; |
| 419 | return !sysctl_is_seen(PROC_I(inode)->sysctl); | 420 | head = rcu_dereference(PROC_I(inode)->sysctl); |
| 421 | return !head || !sysctl_is_seen(head); | ||
| 420 | } | 422 | } |
| 421 | 423 | ||
| 422 | static const struct dentry_operations proc_sys_dentry_operations = { | 424 | static const struct dentry_operations proc_sys_dentry_operations = { |
