* [PATCH] mm/shmem: initialize folio to NULL
@ 2022-05-09 12:31 Tom Rix
2022-05-09 13:59 ` Matthew Wilcox
0 siblings, 1 reply; 4+ messages in thread
From: Tom Rix @ 2022-05-09 12:31 UTC (permalink / raw)
To: hughd, akpm, nathan, ndesaulniers, willy
Cc: linux-mm, linux-kernel, llvm, Tom Rix
The clang build fails with
mm/shmem.c:1704:7: error: variable 'folio' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (!page) {
^~~~~
The error handler for !page jumps to an if-check for an unset folio.
So initialize folio to NULL.
Fixes: 2b58b3f33ba2 ("mm/shmem: convert shmem_swapin_page() to shmem_swapin_folio()")
Signed-off-by: Tom Rix <trix@redhat.com>
---
mm/shmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 107f1e4dd0aa..7faaa61ff7fa 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1682,7 +1682,7 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index,
struct shmem_inode_info *info = SHMEM_I(inode);
struct mm_struct *charge_mm = vma ? vma->vm_mm : NULL;
struct page *page;
- struct folio *folio;
+ struct folio *folio = NULL;
swp_entry_t swap;
int error;
--
2.27.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/shmem: initialize folio to NULL
2022-05-09 12:31 [PATCH] mm/shmem: initialize folio to NULL Tom Rix
@ 2022-05-09 13:59 ` Matthew Wilcox
2022-05-09 14:51 ` Tom Rix
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2022-05-09 13:59 UTC (permalink / raw)
To: Tom Rix; +Cc: hughd, akpm, nathan, ndesaulniers, linux-mm, linux-kernel, llvm
On Mon, May 09, 2022 at 08:31:16AM -0400, Tom Rix wrote:
> The clang build fails with
> mm/shmem.c:1704:7: error: variable 'folio' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
> if (!page) {
> ^~~~~
> The error handler for !page jumps to an if-check for an unset folio.
> So initialize folio to NULL.
I appreciate you're trying to help, but the fourth report of a problem
adds more noise than utility.
https://lore.kernel.org/linux-mm/?q=shmem+folio
shows emails about this from the cgelbot, Dan Carpenter, SeongJae Park,
Colin King, Nathan Chancellor and Sebastian Siewior. So actually you
were seventh, not fourth.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/shmem: initialize folio to NULL
2022-05-09 13:59 ` Matthew Wilcox
@ 2022-05-09 14:51 ` Tom Rix
2022-05-09 14:53 ` Matthew Wilcox
0 siblings, 1 reply; 4+ messages in thread
From: Tom Rix @ 2022-05-09 14:51 UTC (permalink / raw)
To: Matthew Wilcox
Cc: hughd, akpm, nathan, ndesaulniers, linux-mm, linux-kernel, llvm
On 5/9/22 6:59 AM, Matthew Wilcox wrote:
> On Mon, May 09, 2022 at 08:31:16AM -0400, Tom Rix wrote:
>> The clang build fails with
>> mm/shmem.c:1704:7: error: variable 'folio' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
>> if (!page) {
>> ^~~~~
>> The error handler for !page jumps to an if-check for an unset folio.
>> So initialize folio to NULL.
> I appreciate you're trying to help, but the fourth report of a problem
> adds more noise than utility.
>
> https://lore.kernel.org/linux-mm/?q=shmem+folio
>
> shows emails about this from the cgelbot, Dan Carpenter, SeongJae Park,
> Colin King, Nathan Chancellor and Sebastian Siewior. So actually you
> were seventh, not fourth.
From my point of view, the build has been broken for a week.
It would be good if this and the other folio issue was fixed in
linux-next soon.
Tom
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/shmem: initialize folio to NULL
2022-05-09 14:51 ` Tom Rix
@ 2022-05-09 14:53 ` Matthew Wilcox
0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2022-05-09 14:53 UTC (permalink / raw)
To: Tom Rix; +Cc: hughd, akpm, nathan, ndesaulniers, linux-mm, linux-kernel, llvm
On Mon, May 09, 2022 at 07:51:25AM -0700, Tom Rix wrote:
>
> On 5/9/22 6:59 AM, Matthew Wilcox wrote:
> > On Mon, May 09, 2022 at 08:31:16AM -0400, Tom Rix wrote:
> > > The clang build fails with
> > > mm/shmem.c:1704:7: error: variable 'folio' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
> > > if (!page) {
> > > ^~~~~
> > > The error handler for !page jumps to an if-check for an unset folio.
> > > So initialize folio to NULL.
> > I appreciate you're trying to help, but the fourth report of a problem
> > adds more noise than utility.
> >
> > https://lore.kernel.org/linux-mm/?q=shmem+folio
> >
> > shows emails about this from the cgelbot, Dan Carpenter, SeongJae Park,
> > Colin King, Nathan Chancellor and Sebastian Siewior. So actually you
> > were seventh, not fourth.
>
> From my point of view, the build has been broken for a week.
Yeah, shit happens when you're trying to fix patches and attend a
conference at the same time.
> It would be good if this and the other folio issue was fixed in linux-next
> soon.
As you can see, I sent a replacement patch series on the 4th which fixes
far more than the two problems you noticed.
https://lore.kernel.org/linux-mm/20220504182857.4013401-1-willy@infradead.org/
I can do no more than this.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-05-09 14:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 12:31 [PATCH] mm/shmem: initialize folio to NULL Tom Rix
2022-05-09 13:59 ` Matthew Wilcox
2022-05-09 14:51 ` Tom Rix
2022-05-09 14:53 ` Matthew Wilcox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox