[PATCH v1 3/3] mm/memfd_luo: use i_size_write() to set inode size during retrieve
From: Chenghao Duan
Date: Wed Mar 18 2026 - 21:29:36 EST
Use i_size_write() instead of directly assigning to inode->i_size
when restoring the memfd size in memfd_luo_retrieve().
No functional change intended.
Signed-off-by: Chenghao Duan <duanchenghao@xxxxxxxxxx>
---
mm/memfd_luo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memfd_luo.c b/mm/memfd_luo.c
index 413df8c75c1d..5e5971f25c68 100644
--- a/mm/memfd_luo.c
+++ b/mm/memfd_luo.c
@@ -500,7 +500,7 @@ static int memfd_luo_retrieve(struct liveupdate_file_op_args *args)
}
vfs_setpos(file, ser->pos, MAX_LFS_FILESIZE);
- file->f_inode->i_size = ser->size;
+ i_size_write(file_inode(file), ser->size);
if (ser->nr_folios) {
folios_ser = kho_restore_vmalloc(&ser->folios);
--
2.25.1