public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Andrew Morton <akpm@linux-foundation•org>,
	"Eric W. Biederman" <ebiederm@xmission•com>
Cc: Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Linux Next Mailing List <linux-next@vger•kernel.org>,
	Yafang Shao <laoar.shao@gmail•com>
Subject: Re: linux-next: manual merge of the akpm-current tree with the userns tree
Date: Fri, 24 Dec 2021 18:45:20 +1100	[thread overview]
Message-ID: <20211224184520.157a0660@canb.auug.org.au> (raw)
In-Reply-To: <20211221220734.16e36bdf@canb.auug.org.au>

[-- Attachment #1: Type: text/plain, Size: 1945 bytes --]

Hi all,

On Tue, 21 Dec 2021 22:07:34 +1100 Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
> Today's linux-next merge of the akpm-current tree got conflicts in:
> 
>   include/linux/kthread.h
>   kernel/kthread.c
> 
> between commit:
> 
>   40966e316f86 ("kthread: Ensure struct kthread is present for all kthreads")
> 
> from the userns tree and commit:
> 
>   1ac41b3d9ad8 ("kthread: dynamically allocate memory to store kthread's full name")
> 
> from the akpm-current tree.

With the addition of commit

  329b30af470a ("kthread: Generalize pf_io_worker so it can point to struct kthread")

to the userns tree, the resolution is now as below.

-- 
Cheers,
Stephen Rothwell

diff --cc kernel/kthread.c
index 261a3c3b9c6c,8be710f2d83d..000000000000
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@@ -94,7 -95,19 +96,19 @@@ static inline struct kthread *__to_kthr
  	return kthread;
  }
  
+ void get_kthread_comm(char *buf, size_t buf_size, struct task_struct *tsk)
+ {
+ 	struct kthread *kthread = to_kthread(tsk);
+ 
+ 	if (!kthread || !kthread->full_name) {
+ 		__get_task_comm(buf, buf_size, tsk);
+ 		return;
+ 	}
+ 
+ 	strscpy_pad(buf, kthread->full_name, buf_size);
+ }
+ 
 -void set_kthread_struct(struct task_struct *p)
 +bool set_kthread_struct(struct task_struct *p)
  {
  	struct kthread *kthread;
  
@@@ -118,13 -128,17 +132,17 @@@ void free_kthread_struct(struct task_st
  	struct kthread *kthread;
  
  	/*
 -	 * Can be NULL if this kthread was created by kernel_thread()
 -	 * or if kmalloc() in kthread() failed.
 +	 * Can be NULL if kmalloc() in set_kthread_struct() failed.
  	 */
  	kthread = to_kthread(k);
+ 	if (!kthread)
+ 		return;
+ 
  #ifdef CONFIG_BLK_CGROUP
- 	WARN_ON_ONCE(kthread && kthread->blkcg_css);
+ 	WARN_ON_ONCE(kthread->blkcg_css);
  #endif
 +	k->worker_private = NULL;
+ 	kfree(kthread->full_name);
  	kfree(kthread);
  }
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-12-24  7:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 11:07 linux-next: manual merge of the akpm-current tree with the userns tree Stephen Rothwell
2021-12-24  7:45 ` Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-11  6:41 Stephen Rothwell
2021-10-11 14:03 ` Eric W. Biederman
2020-07-09  7:57 Stephen Rothwell
2020-05-22 11:55 Stephen Rothwell
2020-05-12 10:53 Stephen Rothwell
2017-01-25  5:08 Stephen Rothwell
2017-01-26  0:59 ` Eric W. Biederman
2017-01-26  1:43   ` Andrew Morton
2017-01-26  3:55     ` Stephen Rothwell
2016-09-30  7:42 Stephen Rothwell
2016-09-30  9:48 ` Ian Kent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211224184520.157a0660@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=ebiederm@xmission$(echo .)com \
    --cc=laoar.shao@gmail$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox