Public bug reported:
## Summary
While `gallery-dl` was writing a downloaded file to an NTFS volume
mounted with the in-kernel `ntfs3` driver, the NTFS writeback worker
warned because `ntfs_writepages()` passed the positive internal value
`E_NTFS_NONRESIDENT` (556) to `mapping_set_error()`. `writeback_iter()`
then warned, and both the userspace writer and filesystem writeback
worker remained permanently blocked waiting for the same folio.
The userspace process could not receive a pending SIGINT while in
uninterruptible `D` state. A normal shutdown subsequently failed to
complete and the machine ultimately required Alt+SysRq+B.
## Ubuntu/kernel versions
The incident occurred on:
Ubuntu 24.04 LTS
linux-image-7.0.0-28-generic 7.0.0-28.28~24.04.1
The current HWE update is:
linux-image-7.0.0-29-generic 7.0.0-29.29~24.04.2
The packaged `ntfs3` modules from `7.0.0-28` and `7.0.0-29` have the
same source version:
EDCBF60CA44187AFE0DF846
Therefore the current update appears to retain the affected NTFS3
implementation.
## Filesystem and workload
The affected filesystem is a separate 1.8 TiB NTFS data volume on NVMe,
normally mounted at `/mnt/shared` with the following relevant options:
ntfs3 rw,uid=1000,gid=1000,umask=022,windows_names,nofail
The live driver also reported its default `prealloc` option. `gallery-
dl` was performing ordinary buffered writes to a download file whose
name contained Japanese/non-ASCII characters and ended in `.jpg.part`.
The partial file remained 32,784 bytes after the deadlock.
No NVMe media or transport errors were observed. After recovery, Windows
`chkdsk /f` reported no filesystem problems or bad sectors, and the NVMe
SMART health assessment passed with zero media/data-integrity errors.
## Kernel evidence
The first warnings occurred at 2026-08-16 21:25:47:
------------[ cut here ]------------
err = 556
WARNING: lib/errseq.c:75 at errseq_set+0x67/0x90
Workqueue: writeback wb_workfn (flush-259:0)
Call Trace:
__filemap_set_wb_err+0x18/0x90
ntfs_writepages+0x124/0x200 [ntfs3]
do_writepages+0xc4/0x180
__writeback_single_inode+0x45/0x260
writeback_sb_inodes+0x26b/0x5e0
__writeback_inodes_wb+0x54/0x100
wb_writeback+0x1a1/0x360
wb_workfn+0x373/0x470
This was followed immediately by:
WARNING: mm/page-writeback.c:2511 at writeback_iter+0x124/0x170
Workqueue: writeback wb_workfn (flush-259:0)
Call Trace:
ntfs_writepages+0xa9/0x200 [ntfs3]
do_writepages+0xc4/0x180
__writeback_single_inode+0x45/0x260
writeback_sb_inodes+0x26b/0x5e0
After 122 seconds, the userspace writer was reported stuck:
INFO: task gallery-dl:2548829 blocked for more than 122 seconds.
task:gallery-dl state:D
Call Trace:
io_schedule+0x4c/0x80
folio_wait_bit_common+0x13d/0x360
__filemap_get_folio_mpol+0x29e/0x350
iomap_get_folio+0x5f/0x70
iomap_write_begin+0x3ac/0x4a0
iomap_write_iter+0x123/0x340
iomap_file_buffered_write+0xa5/0x110
ntfs_file_write_iter+0x263/0x300 [ntfs3]
The writeback worker was blocked on that folio as well:
INFO: task kworker/u80:0 blocked for more than 122 seconds.
Workqueue: writeback wb_workfn (flush-259:0)
Call Trace:
io_schedule+0x4c/0x80
folio_wait_bit_common+0x13d/0x360
__folio_lock+0x17/0x30
writeback_get_folio+0x1dc/0x210
writeback_iter+0x64/0x170
iomap_writepages+0x75/0xd0
ntfs_writepages+0x16c/0x200 [ntfs3]
The same tasks were still blocked after 614 seconds and remained stuck
until reboot.
## Suspected cause and upstream candidate
In the affected NTFS3 implementation, the resident writeback helper
contains:
ret = attr_data_write_resident(ni, folio);
if (ret != E_NTFS_NONRESIDENT)
folio_unlock(folio);
mapping_set_error(mapping, ret);
When conversion from resident to nonresident data returns the positive
internal sentinel `E_NTFS_NONRESIDENT` (556), this path does not unlock
the folio and passes 556 to `mapping_set_error()`. This matches both
warnings and the subsequent waits in the journal.
Upstream commit:
65bd5da999effd4ddac46c9f6b538ee65a9828c4
fs/ntfs3: fold resident writeback into writepages loop
removes that helper. Its replacement always calls `folio_unlock(folio)`
after `attr_data_write_resident()`, including the `E_NTFS_NONRESIDENT`
path.
Upstream link:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=65bd5da999effd4ddac46c9f6b538ee65a9828c4
The commit message presents the change as a refactor and has no `Fixes:`
or `Cc: stable` tag, but its folio-unlock change appears to address the
exact observed failure.
## Request
Please assess upstream commit `65bd5da999effd4ddac46c9f6b538ee65a9828c4`
for backport to the Ubuntu Noble 7.0 HWE kernel, or provide an
equivalent minimal fix that unlocks the folio and does not pass
`E_NTFS_NONRESIDENT` to `mapping_set_error()`.
I can provide the complete retained journal for the incident boot and
test an Ubuntu-provided candidate kernel or patched module. I am
avoiding deliberate reproduction on the valuable NTFS volume because the
failure requires a hard reboot and could risk data loss.
ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: linux-image-7.0.0-29-generic 7.0.0-29.29~24.04.2
ProcVersionSignature: Ubuntu 7.0.0-29.29~24.04.2-generic 7.0.12
Uname: Linux 7.0.0-29-generic x86_64
ApportVersion: 2.28.3-0ubuntu0.1
Architecture: amd64
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/controlC2: ignat 4338 F.... wireplumber
/dev/snd/controlC0: ignat 4338 F.... wireplumber
/dev/snd/controlC1: ignat 4338 F.... wireplumber
/dev/snd/seq: ignat 4332 F.... pipewire
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Wed Aug 19 16:38:46 2026
InstallationDate: Installed on 2026-03-15 (157 days ago)
InstallationMedia: Ubuntu 24.04.4 LTS "Noble Numbat" - Release amd64 (20260210)
MachineType: SchenkerTechnologiesGmbH XMG ULTRA 17 (Early 2021)
ProcFB: 0 nvidia-drmdrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-7.0.0-29-generic
root=UUID=aa1cdbae-017e-4b46-94cc-6e21f06b3c35 ro quiet splash vt.handoff=7
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No
PulseAudio daemon running, or not running as session daemon.
RelatedPackageVersions:
linux-restricted-modules-7.0.0-29-generic N/A
linux-backports-modules-7.0.0-29-generic N/A
linux-firmware 20240318.git3b128b60-0ubuntu2.29
SourcePackage: linux-hwe-7.0
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 02/01/2021
dmi.bios.release: 7.4
dmi.bios.vendor: INSYDE Corp.
dmi.bios.version: 1.07.04RTR1
dmi.board.asset.tag: No Asset Tag
dmi.board.name: X170KM-G
dmi.board.vendor: SchenkerTechnologiesGmbH
dmi.board.version: Not Applicable
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: SchenkerTechnologiesGmbH
dmi.chassis.version: N/A
dmi.ec.firmware.release: 7.2
dmi.modalias:
dmi:bvnINSYDECorp.:bvr1.07.04RTR1:bd02/01/2021:br7.4:efr7.2:svnSchenkerTechnologiesGmbH:pnXMGULTRA17(Early2021):pvrNotApplicable:rvnSchenkerTechnologiesGmbH:rnX170KM-G:rvrNotApplicable:cvnSchenkerTechnologiesGmbH:ct10:cvrN/A:skuXUL17E21:pfaNotApplicable:
dmi.product.family: Not Applicable
dmi.product.name: XMG ULTRA 17 (Early 2021)
dmi.product.sku: XUL17E21
dmi.product.version: Not Applicable
dmi.sys.vendor: SchenkerTechnologiesGmbH
** Affects: linux-hwe-7.0 (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug cherry-pick noble
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2164537
Title:
NTFS3 resident writeback deadlock leaves writers permanently blocked
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-hwe-7.0/+bug/2164537/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs