Skip to content

Commit

Permalink
Merge tag 'mm-hotfixes-stable-2023-03-14-16-51' of git://git.kernel.o…
Browse files Browse the repository at this point in the history
…rg/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "Eleven hotfixes.

  Four of these are cc:stable and the remainder address post-6.2 issues
  or aren't considered suitable for backporting.

  Seven of these fixes are for MM"

* tag 'mm-hotfixes-stable-2023-03-14-16-51' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  mm/damon/paddr: fix folio_nr_pages() after folio_put() in damon_pa_mark_accessed_or_deactivate()
  mm/damon/paddr: fix folio_size() call after folio_put() in damon_pa_young()
  ocfs2: fix data corruption after failed write
  migrate_pages: try migrate in batch asynchronously firstly
  migrate_pages: move split folios processing out of migrate_pages_batch()
  migrate_pages: fix deadlock in batched migration
  .mailmap: add Alexandre Ghiti personal email address
  mailmap: correct Dikshita Agarwal's Qualcomm email address
  mailmap: updates for Jarkko Sakkinen
  mm/userfaultfd: propagate uffd-wp bit when PTE-mapping the huge zeropage
  mm: teach mincore_hugetlb about pte markers
  • Loading branch information
torvalds committed Mar 15, 2023
2 parents 29db00c + dd52a61 commit 26e2878
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 99 deletions.
4 changes: 3 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Alexander Lobakin <[email protected]> <[email protected]>
Alexander Mikhalitsyn <[email protected]> <[email protected]>
Alexander Mikhalitsyn <[email protected]> <[email protected]>
Alexandre Belloni <[email protected]> <[email protected]>
Alexandre Ghiti <[email protected]> <[email protected]>
Alexei Starovoitov <[email protected]> <[email protected]>
Alexei Starovoitov <[email protected]> <[email protected]>
Alexei Starovoitov <[email protected]> <[email protected]>
Expand Down Expand Up @@ -121,7 +122,7 @@ Dengcheng Zhu <[email protected]> <[email protected]>
Dengcheng Zhu <[email protected]> <[email protected]>
Dengcheng Zhu <[email protected]> <[email protected]>
<[email protected]> <[email protected]>
Dikshita Agarwal <[email protected].com> <[email protected]>
Dikshita Agarwal <quic_dikshita@quicinc.com> <[email protected]>
Dmitry Baryshkov <[email protected]>
Dmitry Baryshkov <[email protected]> <[[email protected]]>
Dmitry Baryshkov <[email protected]> <[email protected]>
Expand Down Expand Up @@ -194,6 +195,7 @@ Jan Glauber <[email protected]> <[email protected]>
Jan Glauber <[email protected]> <[email protected]>
Jarkko Sakkinen <[email protected]> <[email protected]>
Jarkko Sakkinen <[email protected]> <[email protected]>
Jarkko Sakkinen <[email protected]> <[email protected]>
Jason Gunthorpe <[email protected]> <[email protected]>
Jason Gunthorpe <[email protected]> <[email protected]>
Jason Gunthorpe <[email protected]> <[email protected]>
Expand Down
19 changes: 17 additions & 2 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,11 +1977,26 @@ int ocfs2_write_end_nolock(struct address_space *mapping,
}

if (unlikely(copied < len) && wc->w_target_page) {
loff_t new_isize;

if (!PageUptodate(wc->w_target_page))
copied = 0;

ocfs2_zero_new_buffers(wc->w_target_page, start+copied,
start+len);
new_isize = max_t(loff_t, i_size_read(inode), pos + copied);
if (new_isize > page_offset(wc->w_target_page))
ocfs2_zero_new_buffers(wc->w_target_page, start+copied,
start+len);
else {
/*
* When page is fully beyond new isize (data copy
* failed), do not bother zeroing the page. Invalidate
* it instead so that writeback does not get confused
* put page & buffer dirty bits into inconsistent
* state.
*/
block_invalidate_folio(page_folio(wc->w_target_page),
0, PAGE_SIZE);
}
}
if (wc->w_target_page)
flush_dcache_page(wc->w_target_page);
Expand Down
5 changes: 2 additions & 3 deletions mm/damon/paddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz)
accessed = false;
else
accessed = true;
folio_put(folio);
goto out;
}

Expand All @@ -144,10 +143,10 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz)

if (need_lock)
folio_unlock(folio);
folio_put(folio);

out:
*folio_sz = folio_size(folio);
folio_put(folio);
return accessed;
}

Expand Down Expand Up @@ -281,8 +280,8 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate(
folio_mark_accessed(folio);
else
folio_deactivate(folio);
folio_put(folio);
applied += folio_nr_pages(folio);
folio_put(folio);
}
return applied * PAGE_SIZE;
}
Expand Down
6 changes: 4 additions & 2 deletions mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,7 @@ static void __split_huge_zero_page_pmd(struct vm_area_struct *vma,
{
struct mm_struct *mm = vma->vm_mm;
pgtable_t pgtable;
pmd_t _pmd;
pmd_t _pmd, old_pmd;
int i;

/*
Expand All @@ -2048,7 +2048,7 @@ static void __split_huge_zero_page_pmd(struct vm_area_struct *vma,
*
* See Documentation/mm/mmu_notifier.rst
*/
pmdp_huge_clear_flush(vma, haddr, pmd);
old_pmd = pmdp_huge_clear_flush(vma, haddr, pmd);

pgtable = pgtable_trans_huge_withdraw(mm, pmd);
pmd_populate(mm, &_pmd, pgtable);
Expand All @@ -2057,6 +2057,8 @@ static void __split_huge_zero_page_pmd(struct vm_area_struct *vma,
pte_t *pte, entry;
entry = pfn_pte(my_zero_pfn(haddr), vma->vm_page_prot);
entry = pte_mkspecial(entry);
if (pmd_uffd_wp(old_pmd))
entry = pte_mkuffd_wp(entry);
pte = pte_offset_map(&_pmd, haddr);
VM_BUG_ON(!pte_none(*pte));
set_pte_at(mm, haddr, pte, entry);
Expand Down
Loading

0 comments on commit 26e2878

Please sign in to comment.