public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Jens Axboe <axboe@kernel•dk>, Al Viro <viro@ZenIV•linux.org.uk>
Cc: Linux Next Mailing List <linux-next@vger•kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Aleksa Sarai <cyphar@cyphar•com>
Subject: linux-next: manual merge of the block tree with the vfs tree
Date: Fri, 20 Dec 2019 12:36:14 +1100	[thread overview]
Message-ID: <20191220123614.5f11d2e3@canb.auug.org.au> (raw)

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

Hi all,

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

  fs/open.c

between commit:

  0a51692d49ec ("open: introduce openat2(2) syscall")

from the vfs tree and commit:

  252270311374 ("fs: make build_open_flags() available internally")

from the block tree.

I fixed it up (see at end, plus the merge fix patch 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.

From: Stephen Rothwell <sfr@canb•auug.org.au>
Date: Fri, 20 Dec 2019 11:50:51 +1100
Subject: [PATCH] io_uring: fix up for "open: introduce openat2(2) syscall"

Signed-off-by: Stephen Rothwell <sfr@canb•auug.org.au>
---
 fs/internal.h | 3 ++-
 fs/io_uring.c | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/internal.h b/fs/internal.h
index 166134be439f..dabf747c14fd 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -124,7 +124,8 @@ extern struct file *do_filp_open(int dfd, struct filename *pathname,
 		const struct open_flags *op);
 extern struct file *do_file_open_root(struct dentry *, struct vfsmount *,
 		const char *, const struct open_flags *);
-extern int build_open_flags(int flags, umode_t mode, struct open_flags *op);
+extern struct open_how build_open_how(int flags, umode_t mode);
+extern int build_open_flags(const struct open_how *how, struct open_flags *op);
 
 long do_sys_ftruncate(unsigned int fd, loff_t length, int small);
 long do_faccessat(int dfd, const char __user *filename, int mode);
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 26edb980df02..c756b8fc44c6 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2337,19 +2337,21 @@ static int io_openat(struct io_kiocb *req, struct io_kiocb **nxt,
 		     bool force_nonblock)
 {
 	struct open_flags op;
+	struct open_how how;
 	struct file *file;
 	int ret;
 
 	ret = io_openat_prep(req);
 	if (ret)
 		goto err;
-	ret = build_open_flags(req->open.flags, req->open.mode, &op);
+	how = build_open_how(req->open.flags, req->open.mode);
+	ret = build_open_flags(&how, &op);
 	if (ret)
 		goto err;
 	if (force_nonblock)
 		op.lookup_flags |= LOOKUP_NONBLOCK;
 
-	ret = get_unused_fd_flags(req->open.flags);
+	ret = get_unused_fd_flags(how.flags);
 	if (ret < 0)
 		goto err;
 
-- 
2.24.0

-- 
Cheers,
Stephen Rothwell

diff --cc fs/open.c
index 50a46501bcc9,24cb5d58bbda..000000000000
--- a/fs/open.c
+++ b/fs/open.c
@@@ -955,29 -955,8 +955,29 @@@ struct file *open_with_fake_path(const 
  }
  EXPORT_SYMBOL(open_with_fake_path);
  
 -inline int build_open_flags(int flags, umode_t mode, struct open_flags *op)
 +#define WILL_CREATE(flags)	(flags & (O_CREAT | __O_TMPFILE))
 +#define O_PATH_FLAGS		(O_DIRECTORY | O_NOFOLLOW | O_PATH | O_CLOEXEC)
 +
- static inline struct open_how build_open_how(int flags, umode_t mode)
++inline struct open_how build_open_how(int flags, umode_t mode)
 +{
 +	struct open_how how = {
 +		.flags = flags & VALID_OPEN_FLAGS,
 +		.mode = mode & S_IALLUGO,
 +	};
 +
 +	/* O_PATH beats everything else. */
 +	if (how.flags & O_PATH)
 +		how.flags &= O_PATH_FLAGS;
 +	/* Modes should only be set for create-like flags. */
 +	if (!WILL_CREATE(how.flags))
 +		how.mode = 0;
 +	return how;
 +}
 +
- static inline int build_open_flags(const struct open_how *how,
++inline int build_open_flags(const struct open_how *how,
 +				   struct open_flags *op)
  {
 +	int flags = how->flags;
  	int lookup_flags = 0;
  	int acc_mode = ACC_MODE(flags);
  

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

             reply	other threads:[~2019-12-20  1:36 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20  1:36 Stephen Rothwell [this message]
2019-12-20  5:34 ` linux-next: manual merge of the block tree with the vfs tree Jens Axboe
2020-01-20  1:40   ` Stephen Rothwell
2020-01-20  2:45     ` Jens Axboe
2020-01-20  2:57       ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2024-05-10  2:34 Stephen Rothwell
2024-05-14  1:32 ` Stephen Rothwell
2022-11-28  0:20 Stephen Rothwell
2022-07-15  3:09 Stephen Rothwell
2022-07-14  2:08 Stephen Rothwell
2022-07-14 16:36 ` Jens Axboe
2022-07-15  0:52   ` Al Viro
2022-07-15  1:04     ` Al Viro
2022-07-18  2:59       ` Stephen Rothwell
2022-07-18  4:58         ` Al Viro
2022-07-19 16:52           ` Jens Axboe
2022-07-20  2:45             ` Al Viro
2022-07-20  3:00               ` Jens Axboe
2022-07-11  3:57 Stephen Rothwell
2022-07-11  3:38 Stephen Rothwell
2022-05-23  2:28 Stephen Rothwell
2022-05-23  2:58 ` Jens Axboe
2022-05-23 22:54 ` Stephen Rothwell
2021-01-27  3:24 Stephen Rothwell
2018-05-29  4:37 Stephen Rothwell
2018-05-29  4:33 Stephen Rothwell
2018-05-29  8:12 ` Christoph Hellwig
2018-05-29 14:22   ` Jens Axboe
2018-05-29 21:40     ` Stephen Rothwell
2018-05-29 22:17       ` Jens Axboe
2017-02-02  2:44 Stephen Rothwell
2017-02-21 22:14 ` Stephen Rothwell
2016-12-12  1:31 Stephen Rothwell
2016-12-12  1:44 ` Al Viro
2016-12-12  2:00 ` Ming Lei
2015-02-09  3:55 Stephen Rothwell
2015-01-27  3:57 Stephen Rothwell
2015-01-27  4:00 ` Jens Axboe
2015-01-27  4:54   ` Al Viro
2015-01-28 17:11     ` Christoph Hellwig
2015-01-29  5:15       ` Al Viro
2015-02-01  5:56         ` Al Viro
2015-02-02  8:06           ` Christoph Hellwig
2013-04-04  2:16 Stephen Rothwell
2010-05-18  3:04 Stephen Rothwell
2010-05-18 15:37 ` H Hartley Sweeten

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=20191220123614.5f11d2e3@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=axboe@kernel$(echo .)dk \
    --cc=cyphar@cyphar$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=viro@ZenIV$(echo .)linux.org.uk \
    /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