Re: [PATCH v4 13/19] mm/shmem_luo: Allow preserving tmpfs files
From: Pratyush Yadav
Date: Fri Nov 20 2026 - 08:55:28 EST
On Wed, Nov 11 2026, David Matlack wrote:
> Allow preserving files on tmpfs mounts by dropping the link count check
> from shmem_luo_can_preserve(). The check was meant to limit preservation
> to memfds, which never have links. It isn't needed anymore, since tmpfs
> files are now retrieved into a file on a tmpfs mount.
>
> Userspace can keep using a linked file by its path until the Live
> Update. The path of the file isn't preserved. Userspace creates the file
> to retrieve it into, and can then link that file at the path it wants.
>
> Preserving a linked file affects everyone who opens it by its path,
> since its size is frozen while it is preserved. The permission check
> added by "mm/shmem_luo: Require permission to preserve a file" covers
> that: Callers need permission to write to the file, or must own it if
> its size can't change anyway.
>
> Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx>
> Acked-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
Reviewed-by: Pratyush Yadav (Google) <pratyush@xxxxxxxxxx>
[...]
--
Regards,
Pratyush Yadav