[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <b55d1f04-aadc-490e-a8b5-fe1588f3c9c0@app.fastmail.com>
Date: Tue, 26 Nov 2024 09:49:05 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Naresh Kamboju" <naresh.kamboju@...aro.org>, netfs@...ts.linux.dev,
linux-fsdevel@...r.kernel.org, "open list" <linux-kernel@...r.kernel.org>,
lkft-triage@...ts.linaro.org
Cc: "Jeff Layton" <jlayton@...nel.org>, "David Howells" <dhowells@...hat.com>,
"Dan Carpenter" <dan.carpenter@...aro.org>,
"Anders Roxell" <anders.roxell@...aro.org>
Subject: Re: fs/netfs/read_retry.c:235:20: error: variable 'subreq' is uninitialized
when used here [-Werror,-Wuninitialized]
On Tue, Nov 26, 2024, at 09:25, Naresh Kamboju wrote:
> The x86_64 builds failed with clang-19 and clang-nightly on the Linux
> next-20241125 tag.
> Same build pass with gcc-13.
> Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
>
> Build error:
> ---------
> fs/netfs/read_retry.c:235:20: error: variable 'subreq' is
> uninitialized when used here [-Werror,-Wuninitialized]
> 235 | if (list_is_last(&subreq->rreq_link, &stream->subrequests))
> | ^~~~~~
> fs/netfs/read_retry.c:28:36: note: initialize the variable 'subreq' to
> silence this warning
> 28 | struct netfs_io_subrequest *subreq;
> | ^
> | = NULL
> 1 error generated.
> make[5]: *** [scripts/Makefile.build:194: fs/netfs/read_retry.o] Error 1
This broke in 1bd9011ee163 ("netfs: Change the read result
collector to only use one work item"), which introduced an
extra "subreq" variable in the "do {} while()" loop that
shadows the one in the function body.
The one pointed out by the compiler is not initialized
anywhere. My best guess is that the extra declaration should
just be removed here:
--- a/fs/netfs/read_retry.c
+++ b/fs/netfs/read_retry.c
@@ -72,7 +72,7 @@ static void netfs_retry_read_subrequests(struct netfs_io_request *rreq)
next = stream->subrequests.next;
do {
- struct netfs_io_subrequest *subreq = NULL, *from, *to, *tmp;
+ struct netfs_io_subrequest *from, *to, *tmp;
struct iov_iter source;
unsigned long long start, len;
size_t part;
This also removes an initialization to NULL, but I think
that was not needed regardless.
Arnd
Powered by blists - more mailing lists