netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: "Eric W. Biederman" <ebiederm@xmission.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Networking <netdev@vger.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Song Liu <songliubraving@fb.com>
Subject: linux-next: manual merge of the userns tree with the bpf-next tree
Date: Thu, 26 Nov 2020 16:22:48 +1100	[thread overview]
Message-ID: <20201126162248.7e7963fe@canb.auug.org.au> (raw)

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

Hi all,

Today's linux-next merge of the userns tree got a conflict in:

  kernel/bpf/task_iter.c

between commit:

  91b2db27d3ff ("bpf: Simplify task_file_seq_get_next()")

from the bpf-next tree and commit:

  edc52f17257a ("bpf/task_iter: In task_file_seq_get_next use task_lookup_next_fd_rcu")

from the userns tree.

I fixed it up (I think, 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 kernel/bpf/task_iter.c
index 0458a40edf10,4ec63170c741..000000000000
--- a/kernel/bpf/task_iter.c
+++ b/kernel/bpf/task_iter.c
@@@ -136,41 -135,29 +135,30 @@@ struct bpf_iter_seq_task_file_info 
  };
  
  static struct file *
 -task_file_seq_get_next(struct bpf_iter_seq_task_file_info *info,
 -		       struct task_struct **task)
 +task_file_seq_get_next(struct bpf_iter_seq_task_file_info *info)
  {
  	struct pid_namespace *ns = info->common.ns;
- 	u32 curr_tid = info->tid, max_fds;
- 	struct files_struct *curr_files;
+ 	u32 curr_tid = info->tid;
  	struct task_struct *curr_task;
- 	int curr_fd = info->fd;
+ 	unsigned int curr_fd = info->fd;
  
  	/* If this function returns a non-NULL file object,
- 	 * it held a reference to the task/files_struct/file.
+ 	 * it held a reference to the task/file.
  	 * Otherwise, it does not hold any reference.
  	 */
  again:
 -	if (*task) {
 -		curr_task = *task;
 +	if (info->task) {
 +		curr_task = info->task;
- 		curr_files = info->files;
  		curr_fd = info->fd;
  	} else {
  		curr_task = task_seq_get_next(ns, &curr_tid, true);
 -		if (!curr_task)
 +		if (!curr_task) {
 +			info->task = NULL;
- 			info->files = NULL;
  			return NULL;
 +		}
  
- 		curr_files = get_files_struct(curr_task);
- 		if (!curr_files) {
- 			put_task_struct(curr_task);
- 			curr_tid = ++(info->tid);
- 			info->fd = 0;
- 			goto again;
- 		}
- 
- 		info->files = curr_files;
+ 		/* set *task and info->tid */
 -		*task = curr_task;
 +		info->task = curr_task;
  		if (curr_tid == info->tid) {
  			curr_fd = info->fd;
  		} else {
@@@ -198,10 -183,8 +184,8 @@@
  
  	/* the current task is done, go to the next task */
  	rcu_read_unlock();
- 	put_files_struct(curr_files);
  	put_task_struct(curr_task);
 -	*task = NULL;
 +	info->task = NULL;
- 	info->files = NULL;
  	info->fd = 0;
  	curr_tid = ++(info->tid);
  	goto again;
@@@ -210,13 -193,18 +194,12 @@@
  static void *task_file_seq_start(struct seq_file *seq, loff_t *pos)
  {
  	struct bpf_iter_seq_task_file_info *info = seq->private;
 -	struct task_struct *task = NULL;
  	struct file *file;
  
 -	file = task_file_seq_get_next(info, &task);
 -	if (!file) {
 -		info->task = NULL;
 -		return NULL;
 -	}
 -
 -	if (*pos == 0)
 +	info->task = NULL;
- 	info->files = NULL;
 +	file = task_file_seq_get_next(info);
 +	if (file && *pos == 0)
  		++*pos;
 -	info->task = task;
  
  	return file;
  }

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

             reply	other threads:[~2020-11-26  5:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26  5:22 Stephen Rothwell [this message]
2020-11-26 13:41 ` linux-next: manual merge of the userns tree with the bpf-next tree Eric W. Biederman
2020-12-14 20:04 ` Stephen Rothwell

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=20201126162248.7e7963fe@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    /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).