Re: [PATCH] ntfs: treat any nonzero dio zero-range return as an error

From: Namjae Jeon

Date: Wed Aug 26 2026 - 07:33:54 EST


On Tue, Aug 25, 2026 at 2:47 PM Wentao Guan <guanwentao@xxxxxxxxxxxxx> wrote:
>
> ntfs_dio_zero_range() returns either 0 or a negative errno from
> blkdev_issue_zeroout(); it never returns a positive value. The
> zeroing failure check in ntfs_attr_fallocate() therefore never fired,
> so a failed zeroing operation was silently ignored: the loop kept
> going, the newly allocated clusters were folded into initialized_size
> and the write could succeed leaving stale on-disk data.
>
> Treat any nonzero return as an error and abort the allocation.
>
> Fixes: 495e90fa33482 ("ntfs: update attrib operations")
> Assisted-by: atomcode:deepseek-v4-flash
> Signed-off-by: Wentao Guan <guanwentao@xxxxxxxxxxxxx>
Applied it to #ntfs-next.
Thanks!