Re: [PATCH 2/2] fsnotify: avoid pre-content events when faulting in user pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 11, 2025 at 1:37 PM Lorenzo Stoakes
<lorenzo.stoakes@xxxxxxxxxx> wrote:
>
> On Tue, Mar 11, 2025 at 12:41:53PM +0100, Amir Goldstein wrote:
> > In the use case of buffered write whose input buffer is mmapped file on a
> > filesystem with a pre-content mark, the prefaulting of the buffer can
> > happen under the filesystem freeze protection (obtained in vfs_write())
> > which breaks assumptions of pre-content hook and introduces potential
> > deadlock of HSM handler in userspace with filesystem freezing.
> >
> > Now that we have pre-content hooks at file mmap() time, disable the
> > pre-content event hooks on page fault to avoid the potential deadlock.
> >
> > Leave the code of pre-content hooks in page fault because we may want
> > to re-enable them on executables or user mapped files under certain
> > conditions after resolving the potential deadlocks.
> >
>
> Will leave the fs bits to fs people but not hugely comfortable with the
> concept of 'leaving code in place just in case'.
>
> Often things end up not being the case :)

Fair point.

It's not exactly a "just in case" situation - the existing user of
this code (Meta)
do use the page fault hooks, so I expect they will work on re-enabling
the hooks upstream after this release, but I am fine with reverting the page
fault hooks instead of the temporary disable if that is what everyone wants.

Thanks,
Amir.





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux