do_grow(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 with
  • size β€” 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 πŸ’œ


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