linux-next.vger.kernel.org archive mirror
 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: linux-next: manual merge of the akpm-current tree with the userns tree
Date: Tue, 21 Dec 2021 22:07:34 +1100	[thread overview]
Message-ID: <20211221220734.16e36bdf@canb.auug.org.au> (raw)

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

Hi all,

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.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/kthread.h
index 4f3433afb54b,a1810374eaa9..000000000000
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@@ -33,7 -33,8 +33,8 @@@ struct task_struct *kthread_create_on_c
  					  unsigned int cpu,
  					  const char *namefmt);
  
+ void get_kthread_comm(char *buf, size_t buf_size, struct task_struct *tsk);
 -void set_kthread_struct(struct task_struct *p);
 +bool set_kthread_struct(struct task_struct *p);
  
  void kthread_set_per_cpu(struct task_struct *k, int cpu);
  bool kthread_is_per_cpu(struct task_struct *k);
diff --cc kernel/kthread.c
index c14707d15341,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;
  
@@@ -122,13 -128,17 +136,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->set_child_tid = (__force void __user *)NULL;
+ 	kfree(kthread->full_name);
  	kfree(kthread);
  }
  

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

             reply	other threads:[~2021-12-21 11:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 11:07 Stephen Rothwell [this message]
2021-12-24  7:45 ` linux-next: manual merge of the akpm-current tree with the userns tree Stephen Rothwell
  -- 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=20211221220734.16e36bdf@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).