Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tmpfs: fix data loss from failed fallocate
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. Link: https://lore.kernel.org/linux-mm/[email protected]/ Link: https://lkml.kernel.org/r/[email protected] Fixes: b9a8a41 ("truncate,shmem: Handle truncates that split large folios") Signed-off-by: Hugh Dickins <[email protected]> Reported-by: Guoqi Chen <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Cc: Rui Wang <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Vishal Moola (Oracle) <[email protected]> Cc: <[email protected]> [5.17+] Signed-off-by: Andrew Morton <[email protected]>
- Loading branch information