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 Acked-by: Pasha Tatashin --- mm/shmem_luo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/shmem_luo.c b/mm/shmem_luo.c index 7242664ee4ae..94d617b15489 100644 --- a/mm/shmem_luo.c +++ b/mm/shmem_luo.c @@ -757,9 +757,7 @@ static int shmem_luo_retrieve(struct liveupdate_file_op_args *args) static bool shmem_luo_can_preserve(struct liveupdate_file_handler *handler, struct file *file) { - struct inode *inode = file_inode(file); - - return shmem_file(file) && !inode->i_nlink; + return shmem_file(file); } static unsigned long shmem_luo_get_id(struct file *file) -- 2.56.0.542.g3ef89b7020-goog