jbd2_journal_abort(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

jbd2_journal_abort β€” shut the journal down immediately, like right now, no warning, bye πŸ’…


🌸 SYNOPSIS 🌸

void jbd2_journal_abort (journal_t *journal , int errno );

πŸŽ€ ARGUMENTS πŸŽ€

  • journal β€” the journal you're about to shut down, bestie. like the actual one, hand it over 🫢
  • errno β€” an error number that gets recorded in the journal so everyone knows why we slammed the brakes. receipts, basically 🧾

πŸ’œ DESCRIPTION πŸ’œ

okay so this one is serious. jbd2_journal_abort performs a complete, immediate shutdown of the ENTIRE journal β€” not one single transaction, the whole thing. and like… this cannot be undone unless you close the journal and reopen it. no take-backs. none. 😭

the whole point of this function is to back up higher-level error recovery stuff, for example the ext2/ext3 remount-readonly error mode. it's giving "the grown-ups will handle it from here" energy.

journal abort has very specific semantics, and you need to know them:

  • any existing dirty, unjournaled buffers chillin' in the main filesystem will still get written to disk by bdflush β€” but the journaling mechanism itself is suspended immediately, and no further transaction commits will be honoured. periodt.
  • any dirty, journaled buffers get written back to disk without hitting the journal. atomicity cannot be guaranteed on an aborted filesystem β€” but we _do_ attempt to leave as much data as possible behind so fsck can use it for cleanup. doing the most for the cleanup crew fr fr 🧚
  • any attempt to grab a new transaction handle on a journal sitting in ABORT state just returns an -EROFS error. that's it, that's the answer.
  • a jbd2_journal_stop on an existing handle will return -EIO if we've entered abort state during the update.
  • recursive transactions are not disturbed by journal abort until the final jbd2_journal_stop, which is the one that receives the -EIO error. so they find out last. iconic, honestly.
  • finally, jbd2_journal_abort lets the caller supply an errno that gets recorded (if possible) in the journal superblock. this means a client can record failure conditions in the middle of a transaction without having to complete that transaction just to get the failure onto disk. ext3_error, for example, now uses this functionality. slay πŸ’…
⚠️ real talk: this is a full shutdown of the entire journal. no undo without closing and reopening. treat it accordingly, ok?

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./fs/jbd2/journal.c β€” and all her friends:


that's the whole page, bestie, no notes πŸ’– mwah πŸ’‹

source location: ./fs/jbd2 Β· version/date situation: October 2026 Β· and she's filed under jbd2_journal_abort(9) β€” go forth and shut journals down responsibly πŸ‘‘βœ¨

πŸ“¦ where this page comes from