pagecache_isize_extended(9)
π NAME π
pagecache_isize_extended β update pagecache after extension of i_size π
Okay bestie, welcome to pagecache_isize_extended(9) from the Kernel API Manual β¨ This one is all about what happens to the pagecache when an inodeβs size gets bigger.
β¨ SYNOPSIS β¨
void pagecache_isize_extended (struct inode *inode , loff_t from ,
loff_t to );
π ARGUMENTS π
inodeβ the inode for whichi_sizewas extended πfromβ the original inode size, aka where it was before πΈtoβ the new inode size, aka the glow-up value π¦
π DESCRIPTION π
So this function handles the extension of an inodeβs size β either because of an extending truncate, or because of a write that starts after the current i_size π«Ά We mark the page straddling the current i_size as RO so that page_mkwrite gets called on the first write access to that page. That way, the filesystem will update its per-block information before the user writes to the page via mmap after the i_size has been changed π
β οΈ Timing check, bestie: this function must be called afteri_sizeis updated, so that a page fault coming after we unlock the folio will already see the newi_sizeπ And it must be called while we still holdi_rwsemβ that not only makes surei_sizeis stable, but also makes sure userspace cannot observe the newi_sizevalue before we are prepared to storemmapwrites at the new inode size π
π₯ SEE ALSO π₯
Kernel file ./mm/truncate.c π and these iconic friends:
folio_invalidate(9)mapping_evict_folio(9)truncate_inode_pages_range(9)truncate_inode_pages(9)truncate_inode_pages_final(9)mapping_try_invalidate(9)invalidate_mapping_pages(9)invalidate_inode_pages2_range(9)invalidate_inode_pages2(9)truncate_pagecache(9)truncate_setsize(9)truncate_pagecache_range(9)
Made with π from source/version ./mm, dated October 2026, and this whole page is pagecache_isize_extended(9) β bye bestie, slay your pagecache π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms