---
name: "pagecache_isize_extended"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/pagecache_isize_extended"
---

# pagecache\_isize\_extended(9)

update pagecache after extension of i\_size

## NAME

pagecache\_isize\_extended - update pagecache after extension of i\_size

## SYNOPSIS

**void pagecache\_isize\_extended(struct inode \*** *inode***, loff\_t** *from***, loff\_t** *to***);**

## ARGUMENTS

*inode*

inode for which i\_size was extended

*from*

original inode size

*to*

new inode size

## DESCRIPTION

Handle extension of inode size either caused by extending truncate or by write starting after current i\_size. We mark the page straddling current i\_size RO so that **page\_mkwrite** is called on the nearest write access to the page. This way filesystem can be sure that **page\_mkwrite** is called on the page before user writes to the page via mmap after the i\_size has been changed.

The function must be called after i\_size is updated so that page fault coming after we unlock the page will already see the new i\_size. The function must be called while we still hold i\_mutex - this not only makes sure i\_size is stable but also that userspace cannot observe new i\_size value before we are prepared to store mmap writes at new inode size.

## COPYRIGHT
