You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: nd->inode is not set on the second attempt in path_walk() unfuck proc_sysctl ->d_compare() minimal fix for do_filp_open() race
This commit is contained in:
+10
-5
@@ -194,9 +194,9 @@ static int sysrq_sysctl_handler(ctl_table *table, int write,
|
||||
static struct ctl_table root_table[];
|
||||
static struct ctl_table_root sysctl_table_root;
|
||||
static struct ctl_table_header root_table_header = {
|
||||
.count = 1,
|
||||
{{.count = 1,
|
||||
.ctl_table = root_table,
|
||||
.ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list),
|
||||
.ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list),}},
|
||||
.root = &sysctl_table_root,
|
||||
.set = &sysctl_table_root.default_set,
|
||||
};
|
||||
@@ -1567,11 +1567,16 @@ void sysctl_head_get(struct ctl_table_header *head)
|
||||
spin_unlock(&sysctl_lock);
|
||||
}
|
||||
|
||||
static void free_head(struct rcu_head *rcu)
|
||||
{
|
||||
kfree(container_of(rcu, struct ctl_table_header, rcu));
|
||||
}
|
||||
|
||||
void sysctl_head_put(struct ctl_table_header *head)
|
||||
{
|
||||
spin_lock(&sysctl_lock);
|
||||
if (!--head->count)
|
||||
kfree(head);
|
||||
call_rcu(&head->rcu, free_head);
|
||||
spin_unlock(&sysctl_lock);
|
||||
}
|
||||
|
||||
@@ -1948,10 +1953,10 @@ void unregister_sysctl_table(struct ctl_table_header * header)
|
||||
start_unregistering(header);
|
||||
if (!--header->parent->count) {
|
||||
WARN_ON(1);
|
||||
kfree(header->parent);
|
||||
call_rcu(&header->parent->rcu, free_head);
|
||||
}
|
||||
if (!--header->count)
|
||||
kfree(header);
|
||||
call_rcu(&header->rcu, free_head);
|
||||
spin_unlock(&sysctl_lock);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user