Fix mmap + page fault deadlocks
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest17 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | powerpc/kvm: Fix kvm_use_magic_pagearch/ | +1 | 0 replies | |
| 2/17 | gup: Turn fault_in_pages_{readable,writeable} into fault_in_{readable,writeable}arch/ arch/ arch/ +7 more | +93 | 0 replies | |
| 3/17 | iov_iter: Turn iov_iter_fault_in_readable into fault_in_iov_iter_readablefs/ fs/ fs/ +6 more | +29 | 0 replies | |
| 4/17 | iov_iter: Introduce fault_in_iov_iter_writeableinclude/ include/ lib/ +1 more | +104 | 0 replies | |
| 5/17 | gfs2: Add wrapper for iomap_file_buffered_writefs/ | +17 | 0 replies | |
| 6/17 | gfs2: Clean up function may_grantfs/ | +69 | 0 replies | |
| 7/17 | gfs2: Move the inode glock locking to gfs2_file_buffered_writefs/ fs/ | +28 | 0 replies | |
| 8/17 | gfs2: Eliminate ip->i_ghfs/ fs/ | +22 | 0 replies | |
| 9/17 | gfs2: Fix mmap + page fault deadlocks for buffered I/Ofs/ | +94 | 0 replies | |
| 10/17 | iomap: Fix iomap_dio_rw return value for user copiesfs/ | +4 | 0 replies | |
| 11/17 | iomap: Support partial direct I/O on user copy failuresfs/ include/ | +13 | 0 replies | |
| 12/17 | iomap: Add done_before argument to iomap_dio_rwfs/ fs/ fs/ +5 more | +32 | 0 replies | |
| 13/17 | gup: Introduce FOLL_NOFAULT flag to disable page faultsinclude/ mm/ | +5 | 0 replies | |
| 14/17 | iov_iter: Introduce nofault flag to disable page faultsinclude/ lib/ | +16 | 0 replies | |
| 15/17 | gfs2: Fix mmap + page fault deadlocks for direct I/Ofs/ | +87 | 0 replies | |
| 16/17 | gfs2: Introduce flag for glock holder auto-demotionfs/ fs/ fs/ | +200 | 0 replies | |
| 17/17 | btrfs: fix deadlock due to page faults during direct IO reads and writesfs/ | +123 | 0 replies |
Reviews trailers per patch
4 of 17 patches have a Reviewed-by or Acked-by.
| Patch | Darrick J. Wong | Christoph Hellwig | Josef Bacik |
|---|---|---|---|
| 1/17 | |||
| 2/17 | |||
| 3/17 | |||
| 4/17 | |||
| 5/17 | |||
| 6/17 | |||
| 7/17 | |||
| 8/17 | |||
| 9/17 | |||
| 10/17 | R-b | R-b | |
| 11/17 | R-b | ||
| 12/17 | R-b | ||
| 13/17 | |||
| 14/17 | |||
| 15/17 | |||
| 16/17 | |||
| 17/17 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH 00/17 stable-5.15.y] Fix mmap + page fault deadlocks
This set fixes a process hang issue in btrfs and gf2 filesystems. When we do a direct IO read or write when the buffer given by the user is memory-mapped to the file range we are going to do IO, we end up ending in a deadlock. This is triggered by the test case generic/647 from fstests.
This fix depends on the iov_iter and iomap changes introduced in the commit c03098d4b9ad ("Merge tag 'gfs2-v5.15-rc5-mmap-fault' ofgit://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2") and they are part of this set for stable-5.15.y.
Please note that patch 3/17 in this patchset changes the prototype and renames an exported symbol as below. All its references are updated as well.
-EXPORT_SYMBOL(iov_iter_fault_in_readable);
+EXPORT_SYMBOL(fault_in_iov_iter_readable);
Andreas Gruenbacher (15):
powerpc/kvm: Fix kvm_use_magic_page
gup: Turn fault_in_pages_{readable,writeable} into
fault_in_{readable,writeable} iov_iter: Turn iov_iter_fault_in_readable into
fault_in_iov_iter_readable
iov_iter: Introduce fault_in_iov_iter_writeable
gfs2: Add wrapper for iomap_file_buffered_write
gfs2: Clean up function may_grant
gfs2: Move the inode glock locking to gfs2_file_buffered_write
gfs2: Eliminate ip->i_gh
gfs2: Fix mmap + page fault deadlocks for buffered I/O
iomap: Fix iomap_dio_rw return value for user copies
iomap: Support partial direct I/O on user copy failures
iomap: Add done_before argument to iomap_dio_rw
gup: Introduce FOLL_NOFAULT flag to disable page faults
iov_iter: Introduce nofault flag to disable page faults
gfs2: Fix mmap + page fault deadlocks for direct I/O
Bob Peterson (1):
gfs2: Introduce flag for glock holder auto-demotion
Filipe Manana (1):
btrfs: fix deadlock due to page faults during direct IO reads and
writes
arch/powerpc/kernel/kvm.c | 3 +- arch/powerpc/kernel/signal_32.c | 4 +- arch/powerpc/kernel/signal_64.c | 2 +- arch/x86/kernel/fpu/signal.c | 7 +- drivers/gpu/drm/armada/armada_gem.c | 7 +- fs/btrfs/file.c | 142 ++++++++++-- fs/btrfs/ioctl.c | 5 +- fs/erofs/data.c | 2 +- fs/ext4/file.c | 5 +- fs/f2fs/file.c | 2 +- fs/fuse/file.c | 2 +- fs/gfs2/bmap.c | 60 +---- fs/gfs2/file.c | 252 +++++++++++++++++++-- fs/gfs2/glock.c | 330 +++++++++++++++++++++------- fs/gfs2/glock.h | 20 ++ fs/gfs2/incore.h | 4 +- fs/iomap/buffered-io.c | 2 +- fs/iomap/direct-io.c | 29 ++- fs/ntfs/file.c | 2 +- fs/ntfs3/file.c | 2 +- fs/xfs/xfs_file.c | 6 +- fs/zonefs/super.c | 4 +- include/linux/iomap.h | 11 +- include/linux/mm.h | 3 +- include/linux/pagemap.h | 58 +---- include/linux/uio.h | 4 +- lib/iov_iter.c | 98 +++++++-- mm/filemap.c | 4 +- mm/gup.c | 139 +++++++++++- 29 files changed, 911 insertions(+), 298 deletions(-)
Signature · 1 line
2.33.1