Skip to content

Commit

Permalink
mm-shmem-fix-race-in-shmem_undo_range-w-thp-fix
Browse files Browse the repository at this point in the history
tidy up comment layout

Cc: David Stevens <stevensd@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
akpm00 committed Jul 4, 2023
1 parent a871afc commit 003cac7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,10 +1035,12 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,
truncate_inode_folio(mapping, folio);
} else if (truncate_inode_partial_folio(folio, lstart, lend)) {
/*
* If we split a page, reset the loop so that we
* pick up the new sub pages. Otherwise the THP
* was entirely dropped or the target range was
* zeroed, so just continue the loop as is.
* If we split a page, reset the loop so
* that we pick up the new sub pages.
* Otherwise the THP was entirely
* dropped or the target range was
* zeroed, so just continue the loop as
* is.
*/
if (!folio_test_large(folio)) {
folio_unlock(folio);
Expand Down

0 comments on commit 003cac7

Please sign in to comment.