Re: [PATCH] ntfs: serialize the resident read iomap path with mrec_lock
From: Hyeontae Lee
Date: Sat Aug 01 2026 - 02:38:29 EST
Hi Namjae,
You are right - my version drops the lock before the iomap core copies from
iomap->inline_data, so the copy itself was still unprotected.
I tested your patch and it fixes the issue:
KCSAN, two runs of 180 seconds each on the same reproducer:
run 1: 206,015 read faults, 415,351 link/unlink cycles
run 2: 205,732 read faults, 421,672 link/unlink cycles
No data-race reports in ntfs_attr_find(), ntfs_attr_value_is_valid() or
ntfs_read_iomap_begin_resident(), and no "is corrupt" messages. Before the
fix the same reproducer produced 40 reports in about one second.
PROVE_LOCKING, 60 seconds with the same reproducer: 1,199,159 read faults,
1,396,557 link/unlink cycles, no lockdep splat. Mount, read, write and
unmount all behave normally.
Tested-by: Hyeontae Lee <wonju345@xxxxxxxxx>
Thanks,
Hyeontae