Re: [PATCH] ovl: implement ->get_unmapped_area()

From: Matthew Wilcox

Date: Fri Aug 28 2026 - 08:53:13 EST


On Fri, Aug 28, 2026 at 02:23:11PM +0200, Amir Goldstein wrote:
> Since mmap is going through backing_file_mmap() probably a good idea to
> pass this method through a backing_file helper as well.
>
> But more importantly, adding MM people to this patch review, mainly the ones
> that participated in the discussion over patch to fix similar issues
> in 2024 [1].
> Most of the concerns in that patch seem to have been addressed (?)
>
> [1] https://lore.kernel.org/linux-unionfs/20241205143038.3260233-1-tujinjiang@xxxxxxxxxx/

No, not at all. All this patch needs to be is:

+++ b/fs/overlayfs/file.c
@@ -657,6 +657,7 @@ const struct file_operations ovl_file_operations = {
.fallocate = ovl_fallocate,
.fadvise = ovl_fadvise,
.flush = ovl_flush,
+ .get_unmapped_area = thp_get_unmapped_area,
.splice_read = ovl_splice_read,
.splice_write = ovl_splice_write,


All this "oh we have to call the underlying filesystem's
get_unmapepd_area" betrays a lack of understanding of the problem.

And Lorenzo suggested this in the linked thread:

https://lore.kernel.org/linux-unionfs/69b72e3d-b101-4641-9ce5-51346c93a98d@lucifer.local/