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.