Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/memfd_luo: use i_size_write() to set inode size during retrieve

Use i_size_write() instead of directly assigning to inode->i_size when
restoring the memfd size in memfd_luo_retrieve(), to keep code
consistency.

No functional change intended.

Link: https://lore.kernel.org/20260326084727.118437-5-duanchenghao@kylinos.cn
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Haoran Jiang <jianghaoran@kylinos.cn>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Chenghao Duan and committed by
Andrew Morton
32f6cec5 4aa6424f

+1 -1
+1 -1
mm/memfd_luo.c
··· 530 530 } 531 531 532 532 vfs_setpos(file, ser->pos, MAX_LFS_FILESIZE); 533 - file->f_inode->i_size = ser->size; 533 + i_size_write(file_inode(file), ser->size); 534 534 535 535 if (ser->nr_folios) { 536 536 folios_ser = kho_restore_vmalloc(&ser->folios);