public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* fs/netfs/read_retry.c:235:20: error: variable 'subreq' is uninitialized when used here [-Werror,-Wuninitialized]
@ 2024-11-26  8:25 Naresh Kamboju
  2024-11-26  8:49 ` Arnd Bergmann
  2024-12-03 16:55 ` David Howells
  0 siblings, 2 replies; 4+ messages in thread
From: Naresh Kamboju @ 2024-11-26  8:25 UTC (permalink / raw)
  To: netfs, linux-fsdevel, open list, lkft-triage
  Cc: Jeff Layton, David Howells, Dan Carpenter, Anders Roxell,
	Arnd Bergmann

The x86_64 builds failed with clang-19 and clang-nightly on the Linux
next-20241125 tag.
Same build pass with gcc-13.

First seen on Linux next-20241125 tag.
  Good: next-20241122
  Bad:  next-20241125 and next-20241126

x86_64:
  build:
    * clang-19-lkftconfig
    * clang-nightly-lkftconfig-lto-full
    * clang-nightly-lkftconfig
    * clang-19-lkftconfig-kcsan
    * korg-clang-19-lkftconfig-lto-full
    * clang-nightly-lkftconfig-lto-thing
    * clang-nightly-lkftconfig-kselftest
    * clang-19-x86_64_defconfig
    * rustclang-nightly-lkftconfig-kselftest
    * clang-19-lkftconfig-no-kselftest-frag
    * korg-clang-19-lkftconfig-hardening
    * korg-clang-19-lkftconfig-lto-thing
    * clang-19-lkftconfig-compat
    * clang-nightly-lkftconfig-hardening
    * clang-nightly-x86_64_defconfig

Reported-by: Linux Kernel Functional Testing <lkft@linaro.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

Build image:
-----------
- https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20241126/testrun/26060810/suite/build/test/clang-19-lkftconfig/log
- https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20241126/testrun/26060810/suite/build/test/clang-19-lkftconfig/details/
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/

Steps to reproduce:
------------
- tuxmake --runtime podman --target-arch x86_64 --toolchain clang-19
--kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/config
LLVM=1 LLVM_IAS=1

The git log shows
$ git log --oneline  next-20241122..next-20241125 -- fs/netfs/read_retry.c
1bd9011ee163e netfs: Change the read result collector to only use one work item
5c962f9982cd9 netfs: Don't use bh spinlock
3c8a83f74e0ea netfs: Drop the was_async arg from netfs_read_subreq_terminated()
2029a747a14d2 netfs: Abstract out a rolling folio buffer implementation

metadata:
----
  git describe: next-20241125 and next-20241126
  git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
  git sha: ed9a4ad6e5bd3a443e81446476718abebee47e82
  kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/config
  build url: https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/
  toolchain: clang-19 and clang-nightly
  config: defconfig, lkftconfig etc
  arch: x86_64

--
Linaro LKFT
https://lkft.linaro.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: fs/netfs/read_retry.c:235:20: error: variable 'subreq' is uninitialized when used here [-Werror,-Wuninitialized]
  2024-11-26  8:25 fs/netfs/read_retry.c:235:20: error: variable 'subreq' is uninitialized when used here [-Werror,-Wuninitialized] Naresh Kamboju
@ 2024-11-26  8:49 ` Arnd Bergmann
  2024-12-03 16:55 ` David Howells
  1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2024-11-26  8:49 UTC (permalink / raw)
  To: Naresh Kamboju, netfs, linux-fsdevel, open list, lkft-triage
  Cc: Jeff Layton, David Howells, Dan Carpenter, Anders Roxell

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@linaro.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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: fs/netfs/read_retry.c:235:20: error: variable 'subreq' is uninitialized when used here [-Werror,-Wuninitialized]
  2024-11-26  8:25 fs/netfs/read_retry.c:235:20: error: variable 'subreq' is uninitialized when used here [-Werror,-Wuninitialized] Naresh Kamboju
  2024-11-26  8:49 ` Arnd Bergmann
@ 2024-12-03 16:55 ` David Howells
  2024-12-12 17:17   ` Nathan Chancellor
  1 sibling, 1 reply; 4+ messages in thread
From: David Howells @ 2024-12-03 16:55 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: dhowells, netfs, linux-fsdevel, open list, lkft-triage,
	Jeff Layton, Dan Carpenter, Anders Roxell, Arnd Bergmann

Naresh Kamboju <naresh.kamboju@linaro.org> wrote:

> 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
> 
> Build image:
> -----------
> - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20241126/testrun/26060810/suite/build/test/clang-19-lkftconfig/log
> - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20241126/testrun/26060810/suite/build/test/clang-19-lkftconfig/details/
> - https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/
> 
> Steps to reproduce:
> ------------
> - tuxmake --runtime podman --target-arch x86_64 --toolchain clang-19
> --kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/config
> LLVM=1 LLVM_IAS=1
> 
> The git log shows
> $ git log --oneline  next-20241122..next-20241125 -- fs/netfs/read_retry.c
> 1bd9011ee163e netfs: Change the read result collector to only use one work item
> 5c962f9982cd9 netfs: Don't use bh spinlock
> 3c8a83f74e0ea netfs: Drop the was_async arg from netfs_read_subreq_terminated()
> 2029a747a14d2 netfs: Abstract out a rolling folio buffer implementation
> 
> metadata:
> ----
>   git describe: next-20241125 and next-20241126
>   git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>   git sha: ed9a4ad6e5bd3a443e81446476718abebee47e82
>   kernel config:
> https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/config

That should be fixed on my branch now:

   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=netfs-writeback

I'm just moving the branch to v6.13-rc1 and fixing reported issues before
asking Christian to repull it.

David


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: fs/netfs/read_retry.c:235:20: error: variable 'subreq' is uninitialized when used here [-Werror,-Wuninitialized]
  2024-12-03 16:55 ` David Howells
@ 2024-12-12 17:17   ` Nathan Chancellor
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2024-12-12 17:17 UTC (permalink / raw)
  To: David Howells, Christian Brauner
  Cc: Naresh Kamboju, netfs, linux-fsdevel, open list, lkft-triage,
	Jeff Layton, Dan Carpenter, Anders Roxell, Arnd Bergmann

On Tue, Dec 03, 2024 at 04:55:55PM +0000, David Howells wrote:
> Naresh Kamboju <naresh.kamboju@linaro.org> wrote:
> 
> > 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
> > 
> > Build image:
> > -----------
> > - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20241126/testrun/26060810/suite/build/test/clang-19-lkftconfig/log
> > - https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20241126/testrun/26060810/suite/build/test/clang-19-lkftconfig/details/
> > - https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/
> > 
> > Steps to reproduce:
> > ------------
> > - tuxmake --runtime podman --target-arch x86_64 --toolchain clang-19
> > --kconfig https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/config
> > LLVM=1 LLVM_IAS=1
> > 
> > The git log shows
> > $ git log --oneline  next-20241122..next-20241125 -- fs/netfs/read_retry.c
> > 1bd9011ee163e netfs: Change the read result collector to only use one work item
> > 5c962f9982cd9 netfs: Don't use bh spinlock
> > 3c8a83f74e0ea netfs: Drop the was_async arg from netfs_read_subreq_terminated()
> > 2029a747a14d2 netfs: Abstract out a rolling folio buffer implementation
> > 
> > metadata:
> > ----
> >   git describe: next-20241125 and next-20241126
> >   git repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> >   git sha: ed9a4ad6e5bd3a443e81446476718abebee47e82
> >   kernel config:
> > https://storage.tuxsuite.com/public/linaro/lkft/builds/2pNKzjvChfT6aOWplZaZeQzbYCX/config
> 
> That should be fixed on my branch now:
> 
>    https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=netfs-writeback
> 
> I'm just moving the branch to v6.13-rc1 and fixing reported issues before
> asking Christian to repull it.

Is there any progress on getting this into -next? This warning has
broken our builds for a grand total of a few weeks at this point...

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-12 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-26  8:25 fs/netfs/read_retry.c:235:20: error: variable 'subreq' is uninitialized when used here [-Werror,-Wuninitialized] Naresh Kamboju
2024-11-26  8:49 ` Arnd Bergmann
2024-12-03 16:55 ` David Howells
2024-12-12 17:17   ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox