Re: [PATCH 1/4] coda: never point a file's f_mapping at a container's mapping

From: Lorenzo Stoakes (ARM)

Date: Mon Nov 30 2026 - 09:09:59 EST


On Sat, Nov 28, 2026 at 02:40:20PM -0500, Jan Harkes wrote:
> Now I am really confused as to what the use of file->f_mapping actually
> is. I thought I understood how this mmap stuff worked, but clearly I do not.

In general, you shouldn't touch this at all :)) This class of bug is really
'mmap() is getting pointers to stuff it shouldn't get, and mmap hook changing
internal state that should not be changed'.

The other stacked file systems use a fundamentally different approach, but it's
all very forgivable because coda did it first, and before any of that machinery
was in place.

I am gradually modernising mmap() into mmap_prepare(), and as part of that I'll
have to fix up all the machinery. I guess I'll make suggestions then as to how
to bring coda into the fold, though it may need a carve-out for backwards
compatibility.

One for the future though! :)

--
Cheers, Lorenzo