Merge branch 'mm-hotfixes-stable' into mm-stable
authorAndrew Morton <akpm@linux-foundation.org>
Sat, 10 Dec 2022 03:31:11 +0000 (19:31 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 10 Dec 2022 03:31:11 +0000 (19:31 -0800)
1  2 
MAINTAINERS
include/linux/swapops.h
mm/gup.c
mm/memcontrol.c
mm/mmap.c
mm/shmem.c

diff --cc MAINTAINERS
Simple merge
Simple merge
diff --cc mm/gup.c
Simple merge
diff --cc mm/memcontrol.c
Simple merge
diff --cc mm/mmap.c
Simple merge
diff --cc mm/shmem.c
@@@ -948,8 -945,18 +948,17 @@@ static void shmem_undo_range(struct ino
                folio_batch_remove_exceptionals(&fbatch);
                folio_batch_release(&fbatch);
                cond_resched();
 -              index++;
        }
  
+       /*
+        * When undoing a failed fallocate, we want none of the partial folio
+        * zeroing and splitting below, but shall want to truncate the whole
+        * folio when !uptodate indicates that it was added by this fallocate,
+        * even when [lstart, lend] covers only a part of the folio.
+        */
+       if (unfalloc)
+               goto whole_folios;
        same_folio = (lstart >> PAGE_SHIFT) == (lend >> PAGE_SHIFT);
        folio = shmem_get_partial_folio(inode, lstart >> PAGE_SHIFT);
        if (folio) {