gfs2_trans_drain(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gfs2_trans_drain β€” wait, hold up, lemme explain

Okay so bestie, welcome to the Kernel API Manual ✨ β€” this one's a little function with a big job, and it's called gfs2_trans_drain. No cap, the name literally tells you what it does, but let's get into it πŸŽ€


🌸 NAME 🌸

gfs2_trans_drain β€” drain the buf and databuf queue for a failed transaction πŸ˜­πŸ’€


✨ SYNOPSIS ✨

void gfs2_trans_drain (struct gfs2_sbd *sdp , struct gfs2_trans *tr );

She returns void, she takes two args, she's iconic, periodt πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • sdp β€” the filesystem, fr fr. This is the struct gfs2_sbd * you're working with 🫢
  • tr β€” the transaction to drain. That's your struct gfs2_trans *, and it's the one getting the cleanup treatment 🧹

πŸ’– DESCRIPTION πŸ’–

Okay so picture this: something went wrong 😭. When this is called, we're taking an error exit for a log write that failed. And here's the thing β€” since we bypassed the after_commit functions, nobody cleaned up after themselves πŸ™ˆ.

So now we gotta do it manually: we need to remove the items from the buf and databuf queue. That's the whole vibe check. She drains, she leaves, she doesn't text back πŸ’…βœ¨

Lowkey important: this is an error-path function β€” you're only here because a log write failed and the normal commit cleanup got skipped. No guessing, that's literally what the manpage says 🫑

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./fs/gfs2/log.c (go read it, iykyk πŸ‘€), plus this whole squad of friends:


mwah πŸ’‹ that's the page! She lives in ./fs/gfs2, and this edition dropped October 2026 🌈⭐ Go forth and drain those queues, bestie β€” you got this πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from