gfs2_file_write_iter(9)
π NAME π
okay so welcome to the gfs2_file_write_iter(9) page from the Kernel API Manual, bestie β¨ β gfs2_file_write_iter is literally here to perform a write to a file. iconic behavior, no cap π
β¨ SYNOPSIS β¨
ssize_t gfs2_file_write_iter (struct kiocb *iocb , struct iov_iter *from
);
π«Ά ARGUMENTS π«Ά
iocbβ the io context. that's the context/vibe of this I/O moment, iykyk π¦fromβ the data to write. yes bestie, this is the data going in π
π DESCRIPTION π
real talk: we have to do a lock/unlock right here to refresh the inode size for O_APPEND writes. if we don't, we can land up writing at the wrong offset ππ
there is still a race β yes, even with this β but provided the app is using its own file locking, this will make O_APPEND work as expected. periodt π₯
bestie please note: the race is still there. this is not a magic βno more racesβ button, it's a βmakes O_APPEND behave as expected when the app does its own file lockingβ situation π«Ά
π SEE ALSO π
Kernel file ./fs/gfs2/file.c is the home base, and the rest of the squad is:
gfs2_llseek(9)gfs2_readdir(9)do_gfs2_set_flags(9)gfs2_size_hint(9)gfs2_allocate_folio_backing(9)gfs2_page_mkwrite(9)gfs2_mmap(9)gfs2_open_common(9)gfs2_open(9)gfs2_release(9)gfs2_fsync(9)calc_max_reserv(9)gfs2_lock(9)gfs2_flock(9)
mwah π β this little page lives in ./fs/gfs2 and it's dated October 2026, slay πβ¨
π¦ 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