do_grow(9)
β¨ do_grow(9) β¨
okay so this is a page from the Kernel API Manual, section 9 β yes bestie, the kernel one, we're in the big leagues now π this little function lives in the GFS2 filesystem code and it's literally just here to touch an inode and maybe make it bigger. iconic behaviour honestly π
π NAME π
do_grow β touch and update inode size π±
π¦ SYNOPSIS π¦
int do_grow (struct inode *inode , u64 size );
πΈ ARGUMENTS πΈ
inodeβ the inode π«Ά like, the actual inode we're messing withsizeβ the new size π the size we want it to be
β¨ DESCRIPTION β¨
so here's the tea β this function updates the timestamps on the inode and may also increase the size of the inode. that's the whole vibe. but listen β you must not call this function with a size that's any smaller than the current inode size. fr fr, that's a hard no π
now for the lore π§ although it's not strictly required to unstuff files here, earlier versions of GFS2 have a bug in the stuffed file reading code, and that bug will result in a buffer overrun if the size is larger than the max stuffed file size π so to prevent that from occurring, such files get unstuffed β but in other cases we can just update the inode size directly and keep it cute β¨
β οΈ reminder bestie: size smaller than the current inode size = not allowed. periodt.
π RETURN π
0 on success, or -ve on error π«‘ (that's a negative value, iykyk)
π SEE ALSO π
Kernel file ./fs/gfs2/bmap.c β and the whole squad of related functions, all here, no gatekeeping π
gfs2_unstuffer_folio(9)gfs2_unstuff_dinode(9)find_metapath(9)metaptr1(9)metapointer(9)lookup_metapath(9)fillup_metapath(9)gfs2_extent_length(9)gfs2_hole_size(9)__gfs2_iomap_alloc(9)gfs2_alloc_size(9)__gfs2_iomap_get(9)gfs2_block_map(9)gfs2_journaled_truncate(9)sweep_bh_for_rgrps(9)find_nonnull_ptr(9)punch_hole(9)do_shrink(9)gfs2_setattr_size(9)gfs2_free_journal_extents(9)gfs2_add_jextent(9)gfs2_map_journal_extents(9)gfs2_write_alloc_required(9)
and that's the whole page, bestie π₯³ source is ./fs/gfs2, dated October 2026, manual name do_grow(9) β slay, go touch some inodes π
π
π¦ 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