jbd2__journal_restart(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« jbd2__journal_restart(9) πŸ’«

okay so bestie, welcome to the Kernel API Manual β€” no seriously, that's the actual manual name, we're in the kernel docs era now 🫢 this one's all about jbd2__journal_restart, and she's lowkey a main character.


🌸 NAME 🌸

jbd2__journal_restart β€” restart a handle .

(yes, there's a lil space before the period, that's just how she is, we don't judge πŸ’…)


✨ SYNOPSIS ✨

int jbd2__journal_restart (handle_t *handle , int nblocks , int
       revoke_records , gfp_t gfp_mask );

like, look at her. four args, returns an int, iconic behavior fr fr πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • handle β€” the handle to restart. your girl. the one getting a glow-up ✨
  • nblocks β€” nr credits requested. that's how many credits you're asking for, no cap.
  • revoke_records β€” number of revoke record credits requested. separate credit pool, separate vibe πŸ¦‹
  • gfp_mask β€” memory allocation flags (for start_this_handle). this is the one that gets handed straight to start_this_handle, iykyk.

πŸ’– DESCRIPTION πŸ’–

Restart a handle for a multi-transaction filesystem operation. literally what it says on the tin πŸ’«

so here's the situation, bestie. picture this: jbd2_journal_extend (the call above this one, the one that just tried and failed) did not manage to grant new buffer credits to a running handle. rough, i know 😭

when that happens, you call jbd2_journal_restart, and the way that this works is:

  • it commits the handle's transaction so far β€” everything up to now, done, logged, bye πŸ‘‹
  • and then it reattaches the handle to a new transaction
  • and that new transaction is one that can guarantee the requested number of credits. slay. that's the whole point πŸ”₯

and here's the cute lil detail: we preserve the reserved handle if there's any attached to the passed in handle. πŸ₯Ί she doesn't get dropped, she gets carried over. periodt.

⚠️ heads up: this is the one you reach for after jbd2_journal_extend fails. don't skip the extend step and come crying to restart, that's not the vibe check she's here for πŸ™ˆ

πŸ” SEE ALSO πŸ”

Kernel file ./fs/jbd2/transaction.c β€” that's where the magic lives, go read it 🧚

and the whole squad, in order:


okay that's the whole page, you ate that πŸ’… mwah πŸ’‹

this lil baddie lives in ./fs/jbd2 and she's dated October 2026 β€” mark your calendars bestie, she's from the future ⭐🌈 and no i will not stop being obsessed with her.

πŸ“¦ where this page comes from