2024-04-04 02:25:16

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the vfs-brauner tree

Hi all,

After merging the vfs-brauner tree, today's linux-next build (i386
defconfig) failed like this:

In file included from include/linux/kernel.h:31,
from include/linux/uio.h:8,
from fs/netfs/direct_write.c:9:
fs/netfs/direct_write.c: In function 'netfs_unbuffered_write_iter_locked':
fs/netfs/internal.h:399:36: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
399 | #define _enter(FMT, ...) no_printk("==> %s("FMT")", __func__, ##__VA_ARGS__)
| ^~~~~~~~~
include/linux/printk.h:129:25: note: in definition of macro 'no_printk'
129 | _printk(fmt, ##__VA_ARGS__); \
| ^~~
fs/netfs/direct_write.c:40:9: note: in expansion of macro '_enter'
40 | _enter("%lx", iov_iter_count(iter));
| ^~~~~~
cc1: all warnings being treated as errors
In file included from include/linux/kernel.h:31,
from include/linux/cpumask.h:11,
from arch/x86/include/asm/cpumask.h:5,
from arch/x86/include/asm/msr.h:11,
from arch/x86/include/asm/tsc.h:10,
from arch/x86/include/asm/timex.h:6,
from include/linux/timex.h:67,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from net/9p/client.c:11:
net/9p/client.c: In function 'p9_client_write_subreq':
include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/printk.h:429:25: note: in definition of macro 'printk_index_wrap'
429 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
include/linux/printk.h:500:9: note: in expansion of macro 'printk'
500 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
include/linux/kern_levels.h:11:25: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:500:16: note: in expansion of macro 'KERN_ERR'
500 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
net/9p/client.c:1702:17: note: in expansion of macro 'pr_err'
1702 | pr_err("bogus RWRITE count (%d > %lu)\n", written, len);
| ^~~~~~
cc1: all warnings being treated as errors

Caused by commits

1351be4f832e ("netfs, 9p: Implement helpers for new write code")
671136799613 ("netfs: Remove the old writeback code")

I have applied the following patch for today.

From: Stephen Rothwell <[email protected]>
Date: Thu, 4 Apr 2024 13:17:42 +1100
Subject: [PATCH] fixup for "netfs, 9p: Implement helpers for new write code"

and "netfs: Remove the old writeback code"

Signed-off-by: Stephen Rothwell <[email protected]>
---
fs/netfs/direct_write.c | 2 +-
net/9p/client.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/netfs/direct_write.c b/fs/netfs/direct_write.c
index e4a9cf7cd234..a2f9a4917ab6 100644
--- a/fs/netfs/direct_write.c
+++ b/fs/netfs/direct_write.c
@@ -37,7 +37,7 @@ static ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov
size_t len = iov_iter_count(iter);
bool async = !is_sync_kiocb(iocb);

- _enter("%lx", iov_iter_count(iter));
+ _enter("%zx", iov_iter_count(iter));

/* We're going to need a bounce buffer if what we transmit is going to
* be different in some way to the source buffer, e.g. because it gets
diff --git a/net/9p/client.c b/net/9p/client.c
index dada0033d71e..d4b88b7ff5ef 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1699,7 +1699,7 @@ p9_client_write_subreq(struct netfs_io_subrequest *subreq)
}

if (written > len) {
- pr_err("bogus RWRITE count (%d > %lu)\n", written, len);
+ pr_err("bogus RWRITE count (%d > %zu)\n", written, len);
written = len;
}

--
2.43.0

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-04-04 07:50:27

by David Howells

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the vfs-brauner tree

Stephen Rothwell <[email protected]> wrote:

> diff --git a/net/9p/client.c b/net/9p/client.c
> index dada0033d71e..d4b88b7ff5ef 100644
> --- a/net/9p/client.c
> +++ b/net/9p/client.c
> @@ -1699,7 +1699,7 @@ p9_client_write_subreq(struct netfs_io_subrequest *subreq)
> }
>
> if (written > len) {
> - pr_err("bogus RWRITE count (%d > %lu)\n", written, len);
> + pr_err("bogus RWRITE count (%d > %zu)\n", written, len);
> written = len;
> }

Actually, that's the wrong fix. 'len' needs to be int not size_t because of
the varargs packet formatter.

David