linux-next: build failure after merge of the block tree

From: Stephen Rothwell
Date: Sun Jan 05 2020 - 20:30:37 EST


Hi all,

After merging the block tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:

fs/open.c:977:12: error: conflicting types for 'build_open_flags'
977 | inline int build_open_flags(const struct open_how *how,
| ^~~~~~~~~~~~~~~~
In file included from /home/sfr/next/next/fs/open.c:36:
fs/internal.h:127:12: note: previous declaration of 'build_open_flags' was here
127 | extern int build_open_flags(int flags, umode_t mode, struct open_flags *op);
| ^~~~~~~~~~~~~~~~

Caused by commits

4e9e15c9426e ("fs: make build_open_flags() available internally")
3bba3e571bc8 ("io_uring: add support for IORING_OP_OPENAT")

interacting with commit

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

from the vfs tree.

I have applied the following fix up patch for today:

From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxx>
---
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 c770c2c0eb52..60ebdea1d8c6 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2476,16 +2476,18 @@ 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 = 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

Attachment: pgpcNMgyHnoAD.pgp
Description: OpenPGP digital signature