pagecache_isize_extended(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 which i_size was 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 after i_size is updated, so that a page fault coming after we unlock the folio will already see the new i_size 😭 And it must be called while we still hold i_rwsem β€” that not only makes sure i_size is stable, but also makes sure userspace cannot observe the new i_size value before we are prepared to store mmap writes at the new inode size πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./mm/truncate.c πŸ‘€ and these iconic friends:


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