From: Stephen Rothwell <sfr@canb.auug.org.au>
To: "Eric W. Biederman" <ebiederm@xmission.com>,
David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>,
Networking <netdev@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Song Liu <songliubraving@fb.com>
Subject: Re: linux-next: manual merge of the userns tree with the bpf-next tree
Date: Tue, 15 Dec 2020 07:04:47 +1100 [thread overview]
Message-ID: <20201215070447.6b1f8bd9@canb.auug.org.au> (raw)
In-Reply-To: <20201126162248.7e7963fe@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 3701 bytes --]
Hi all,
On Thu, 26 Nov 2020 16:22:48 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> 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;
> }
Just a reminder that this conflict still exists. Commit 91b2db27d3ff
is now in the net-next tree.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2020-12-14 20:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-26 5:22 Stephen Rothwell
2020-11-26 13:41 ` Eric W. Biederman
2020-12-14 20:04 ` Stephen Rothwell [this message]
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=20201215070447.6b1f8bd9@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=kuba@kernel.org \
--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
all inboxes | Powered by JetHome®