tmpfs-fix-data-loss-from-failed-fallocate.patch removed from -mm tree
The quilt patch titled
Subject: tmpfs: fix data loss from failed fallocate
has been removed from the -mm tree. Its filename was
tmpfs-fix-data-loss-from-failed-fallocate.patch
This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Hugh Dickins <[email protected]>
Subject: tmpfs: fix data loss from failed fallocate
Date: Sun, 4 Dec 2022 16:51:50 -0800 (PST)
Fix tmpfs data loss when the fallocate system call is interrupted by a signal, or fails for some other reason. The partial folio handling in shmem_undo_range() forgot to consider this unfalloc case, and was liable to erase or truncate out data which had already been committed earlier.
It turns out that none of the partial folio handling there is appropriate for the unfalloc case, which just wants to proceed to removal of whole
folios: which find_get_entries() provides, even when partially covered.
Original patch by Rui Wang.
---
mm/shmem.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
mm/shmem.c renamed from mm/shmem.c~tmpfs-fix-data-loss-from-failed-fallocate +11 -0
@@ -948,6 +948,15 @@ static void shmem_undo_range(struct inod 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) {
@@ -973,6 +982,8 @@ static void shmem_undo_range(struct inodfolio_put (folio); } +whole_folios: + index = start;while (index < end) {cond_resched ();
_
Patches currently in -mm which might be from [email protected] are
mm-memcg-fix-swapcached-stat-accounting.patch mmthprmap-fix-races-between-updates-of-subpages_mapcount.patch