Re: [next] x86: fs/hugetlbfs/inode.c:673:16: error: variable 'm_index' is uninitialized when used here [-Werror,-Wuninitialized]

From: Mike Kravetz
Date: Thu Aug 25 2022 - 12:57:06 EST


On 08/25/22 16:13, Naresh Kamboju wrote:
> The x86_64 and i386 clang builds failed due to these warnings / errors
> on Linux next-20220825.
>
> Reported-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx>
>
> fs/hugetlbfs/inode.c:673:16: error: variable 'm_index' is
> uninitialized when used here [-Werror,-Wuninitialized]
> m_start, m_index, truncate_op);
> ^~~~~~~
> fs/hugetlbfs/inode.c:651:26: note: initialize the variable 'm_index'

Thanks! That really should be 'index' and not 'm_index'. The variable
m_index was used in a previous version of the code and should have been
deleted. Depending on the uninitialized value of m_index, this could
cause long delays as the called routine checks the range m_start to m_index.

Andrew, how would you like to address in your tree? The following patch
can be applied on top of the original (next commit fcc0d3d00d74 "hugetlb:
handle truncate racing with page faults"). Or, I could squash and
resend the original, or resend the entire series.