Re: [PATCH v2] ntfs: fix race between fallocate and mmap reads

From: Hyunchul Lee

Date: Thu Aug 27 2026 - 00:44:07 EST


> > Hi Baolin and Hyunchul
> > You're right — that's exactly the unbalanced-unlock path we spotted while
> > preparing v3, and option 2 is what v3 implements. The early exit now
> > does
> > inode_unlock() + direct return, so every path reaching out: holds
> > invalidate_lock, which let us drop map_locked entirely:
> >
> > inode_lock(vi);
> > if (NInoCompressed(...) ) {
> > inode_unlock(vi);
> > return -EOPNOTSUPP;
> > }
> > inode_dio_wait(vi);
> > filemap_invalidate_lock(vi->i_mapping);
> > ...
> > out:
> > filemap_invalidate_unlock(vi->i_mapping);
> > v3 with this cleanup is on its way / attached.
> >
> > Would this v3 approach be OK with you?
> >
> > Thanks,
> > Hongling
>
> Hi Hyunchul,
> I think this approach is good.Looking forward to your feedback.

The approach looks fine to me as well.

>
> Thanks,
> Baolin.
>
>


--
Thanks,
Hyunchul