Re: [PATCH 2/2] ntfs: fix a self-deadlock on writes to non-resident named streams
From: Namjae Jeon
Date: Thu Oct 29 2026 - 04:54:26 EST
On Wed, Oct 28, 2026 at 5:07 PM Hongling Zeng <zenghongling@xxxxxxxxxx> wrote:
>
> The stream write ioctl holds the stream mapping's invalidate lock
> across ntfs_inode_attr_pwrite(), which calls
> ntfs_extend_initialized_size() for named streams, and that function
> takes the same lock again, before the check that could skip the
> extension. A write to a non-resident named stream through
> NTFS_IOC_STREAM_WRITE deadlocks on itself.
>
> The ioctl is the only caller that reaches the named stream branch of
> ntfs_inode_attr_pwrite(), and it always holds the lock there, so
> split off __ntfs_extend_initialized_size(), which expects the caller
> to hold the invalidate lock, and call it from that branch. The write
> and mmap paths keep taking the lock themselves.
>
> Fixes: 3f11c48d4f94 ("ntfs: add pathname access for named streams")
> Signed-off-by: Hongling Zeng <zenghongling@xxxxxxxxxx>
Applied it to #ntfs-next.
Thanks!