The patch titled Subject: hugetlb: fix/remove uninitialized variable in remove_inode_hugepages has been added to the -mm mm-unstable branch. Its filename is hugetlb-handle-truncate-racing-with-page-faults-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/hugetlb-handle-truncate-racing-with-page-faults-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Subject: hugetlb: fix/remove uninitialized variable in remove_inode_hugepages Code introduced for the routine remove_inode_hugepages by patch "hugetlb: handle truncate racing with page faults", incorrectly uses a variable m_index. This is a remnant from a previous version of the code when under development. Use the correct variable 'index' and remove 'm_index' from the routine. Link: https://lkml.kernel.org/r/Ywepr7C2X20ZvLdn@monkey Signed-off-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Cc: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx> Cc: Nathan Chancellor <nathan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/hugetlbfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/hugetlbfs/inode.c~hugetlb-handle-truncate-racing-with-page-faults-fix +++ a/fs/hugetlbfs/inode.c @@ -537,7 +537,7 @@ static void remove_inode_hugepages(struc const pgoff_t start = lstart >> huge_page_shift(h); const pgoff_t end = lend >> huge_page_shift(h); pgoff_t m_end = lm_end >> huge_page_shift(h); - pgoff_t m_start, m_index; + pgoff_t m_start; struct folio_batch fbatch; struct folio *folio; pgoff_t next, index; @@ -559,7 +559,7 @@ static void remove_inode_hugepages(struc * due to a race with fault code. */ freed += fault_lock_inode_indicies(h, inode, mapping, - m_start, m_index, truncate_op); + m_start, index, truncate_op); /* * Remove folio that was part of folio_batch. _ Patches currently in -mm which might be from mike.kravetz@xxxxxxxxxx are hugetlbfs-revert-use-i_mmap_rwsem-to-address-page-fault-truncate-race.patch hugetlbfs-revert-use-i_mmap_rwsem-for-more-pmd-sharing-synchronization.patch hugetlb-rename-remove_huge_page-to-hugetlb_delete_from_page_cache.patch hugetlb-handle-truncate-racing-with-page-faults.patch hugetlb-handle-truncate-racing-with-page-faults-fix.patch hugetlb-rename-vma_shareable-and-refactor-code.patch hugetlb-add-vma-based-lock-for-pmd-sharing.patch hugetlb-create-hugetlb_unmap_file_folio-to-unmap-single-file-folio.patch hugetlb-use-new-vma_lock-for-pmd-sharing-synchronization.patch