LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Andrew Morton <akpm@linux-foundation.org>,
	Christian Brauner <christian@brauner.io>
Cc: Minchan Kim <minchan@kernel.org>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	David Rientjes <rientjes@google.com>
Subject: linux-next: manual merge of the akpm-current tree with the pidfd tree
Date: Tue, 22 Sep 2020 18:54:33 +1000	[thread overview]
Message-ID: <20200922185433.62eafe4c@canb.auug.org.au> (raw)

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

Hi all,

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

  kernel/exit.c

between commit:

  ba7d25f3dff6 ("exit: support non-blocking pidfds")

from the pidfd tree and patch:

  "pid: move pidfd_get_pid() to pid.c"

from the akpm-current tree.

I fixed it up (I made the changes from the former to kernel/pid.c - 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.

I also had to add the following fix patch after

  "mm/madvise: introduce process_madvise() syscall: an external memory hinting API"

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 22 Sep 2020 18:36:35 +1000
Subject: [PATCH] fix up for pidfd_get_pid() API change

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 mm/madvise.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/madvise.c b/mm/madvise.c
index a0ebeb5e2411..51317bd3c69d 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -1189,11 +1189,12 @@ static ssize_t do_process_madvise(int pidfd, struct iov_iter *iter,
 	struct task_struct *task;
 	struct mm_struct *mm;
 	size_t total_len = iov_iter_count(iter);
+	unsigned int pidfd_flags;
 
 	if (flags != 0)
 		return -EINVAL;
 
-	pid = pidfd_get_pid(pidfd);
+	pid = pidfd_get_pid(pidfd, &pidfd_flags);
 	if (IS_ERR(pid))
 		return PTR_ERR(pid);
 
-- 
2.28.0

-- 
Cheers,
Stephen Rothwell

diff --git a/include/linux/pid.h b/include/linux/pid.h
index 176d6cf80e7c..fa10acb8d6a4 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -77,7 +77,7 @@ extern const struct file_operations pidfd_fops;
 struct file;
 
 extern struct pid *pidfd_pid(const struct file *file);
-struct pid *pidfd_get_pid(unsigned int fd);
+struct pid *pidfd_get_pid(unsigned int fd, unsigned int *flags);
 
 static inline struct pid *get_pid(struct pid *pid)
 {
diff --git a/kernel/pid.c b/kernel/pid.c
index c791fe63fa36..47466d0bbc5b 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -520,7 +520,7 @@ struct pid *find_ge_pid(int nr, struct pid_namespace *ns)
 	return idr_get_next(&ns->idr, &nr);
 }
 
-struct pid *pidfd_get_pid(unsigned int fd)
+struct pid *pidfd_get_pid(unsigned int fd, unsigned int *flags)
 {
 	struct fd f;
 	struct pid *pid;
@@ -530,8 +530,10 @@ struct pid *pidfd_get_pid(unsigned int fd)
 		return ERR_PTR(-EBADF);
 
 	pid = pidfd_pid(f.file);
-	if (!IS_ERR(pid))
+	if (!IS_ERR(pid)) {
 		get_pid(pid);
+		*flags = f.file->f_flags;
+	}
 
 	fdput(f);
 	return pid;

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

             reply	other threads:[~2020-09-22  8:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  8:54 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-27 11:43 Stephen Rothwell
2021-01-28  2:04 ` Miaohe Lin
2021-02-14 21:54 ` Stephen Rothwell
2021-02-24 22:41   ` Stephen Rothwell
2019-05-22  1:43 Stephen Rothwell
2019-05-24  8:15 ` Joel Fernandes
2019-07-08 23:12 ` Stephen Rothwell
2019-05-15  3:16 Stephen Rothwell
2019-07-08  2:01 ` Stephen Rothwell
2019-07-12 12:53   ` Joel Fernandes
2019-07-12 13:02     ` Christian Brauner
2019-07-12 13:54       ` Joel Fernandes
2019-04-23  8:46 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=20200922185433.62eafe4c@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=akpm@linux-foundation.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=christian@brauner.io \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=rientjes@google.com \
    --subject='Re: linux-next: manual merge of the akpm-current tree with the pidfd tree' \
    /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

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).