tracing: fprobe-event: Fix to check tracepoint event and return
[linux-block.git] / kernel / fork.c
index 70e301b63a7bdb58502ca8c997afa2a37af4cac1..10917c3e1f0366b5fbf60d98c2042c636cd74c87 100644 (file)
@@ -733,7 +733,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
 
                        get_file(file);
                        i_mmap_lock_write(mapping);
-                       if (tmp->vm_flags & VM_SHARED)
+                       if (vma_is_shared_maywrite(tmp))
                                mapping_allow_writable(mapping);
                        flush_dcache_mmap_lock(mapping);
                        /* insert tmp into the share list, just after mpnt */
@@ -1288,7 +1288,7 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p,
        hugetlb_count_init(mm);
 
        if (current->mm) {
-               mm->flags = current->mm->flags & MMF_INIT_MASK;
+               mm->flags = mmf_init_flags(current->mm->flags);
                mm->def_flags = current->mm->def_flags & VM_INIT_DEF_MASK;
        } else {
                mm->flags = default_dump_filter;
@@ -2411,10 +2411,6 @@ __latent_entropy struct task_struct *copy_process(
        p->io_uring = NULL;
 #endif
 
-#if defined(SPLIT_RSS_COUNTING)
-       memset(&p->rss_stat, 0, sizeof(p->rss_stat));
-#endif
-
        p->default_timer_slack_ns = current->timer_slack_ns;
 
 #ifdef CONFIG_PSI
@@ -2581,7 +2577,6 @@ __latent_entropy struct task_struct *copy_process(
        p->dirty_paused_when = 0;
 
        p->pdeath_signal = 0;
-       INIT_LIST_HEAD(&p->thread_group);
        p->task_works = NULL;
        clear_posix_cputimers_work(p);
 
@@ -2709,8 +2704,6 @@ __latent_entropy struct task_struct *copy_process(
                        atomic_inc(&current->signal->live);
                        refcount_inc(&current->signal->sigcnt);
                        task_join_group_stop(p);
-                       list_add_tail_rcu(&p->thread_group,
-                                         &p->group_leader->thread_group);
                        list_add_tail_rcu(&p->thread_node,
                                          &p->signal->thread_head);
                }