diff options
| author | 2026-09-15 00:19:15 +0900 | |
|---|---|---|
| committer | 2026-10-20 18:41:42 +0900 | |
| commit | fca746064d56329cd81b4f2b1961a3b928c3fe5a (patch) | |
| tree | 3c98884683a933460f78824b48f6d32c1aeeba44 /scripts/Makefile.thinlto | |
| parent | ntfs: fix error handling in ntfs_extent_inode_open and propagate errors (diff) | |
ntfs: avoid truncate and writeback deadlock
ntfs_non_resident_attr_shrink() drops page-cache folios after freeing
clusters and truncating the runlist. The VFS truncate path calls it with
mrec_lock held. A folio writeback can need the same lock to resolve its
iomap mapping, so truncate can wait for writeback while writeback waits
for mrec_lock.
A hung-task call stack:
truncate: mrec_lock -> truncate_inode_pages() -> folio lock/writeback
writeback: folio lock/writeback -> ntfs_write_iomap_begin() ->
mrec_lock
ntfs_setattr_size() already calls truncate_setsize() before
ntfs_truncate_vfs() acquires mrec_lock. Reuse that page-cache truncation
in the VFS path and skip the duplicate truncation under mrec_lock. Keep
the cleanup for internal attribute callers, which do not call
truncate_setsize(). This avoids synchronously flushing the whole
discarded tail while preserving page-cache correctness.
Fixes: 4e646ecd4475 ("ntfs: drop stale page-cache when shrinking a non-resident attr")
Cc: stable@vger.kernel.org
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
