jbd2_journal_dirty_metadata(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… jbd2_journal_dirty_metadata β€” like, the Kernel API Manual era, bestie πŸŽ€

okay so real talk, this page is jbd2_journal_dirty_metadata(9) and it lives in the Kernel API Manual and it is literally the "hey bestie, this buffer is dirty" function, iykyk πŸ’–


✨ NAME ✨

jbd2_journal_dirty_metadata β€” mark a buffer as containing dirty metadata 🫢


🌸 SYNOPSIS 🌸

int jbd2_journal_dirty_metadata (handle_t *handle , struct buffer_head
*bh );

like yes that's the whole vibe, two args, no notes πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • handle β€” the transaction you're adding the buffer to, main character energy fr
  • bh β€” the buffer we're marking, that's the one, slay

πŸ‘‘ DESCRIPTION πŸ‘‘

so what this does is mark dirty metadata that needs to be journaled as part of the current transaction. that's the whole job, iconic behavior honestly ✨

⚠️ but listen, there's a prerequisite and it is not optional: the buffer must have previously had jbd2_journal_get_write_access called on it, so that it has a valid journal_head attached to the buffer head. no cap, if you skip that step you're not doing the vibe check and it's giving chaos πŸ’€

once you do it right, the buffer gets placed on the transaction's metadata list and is marked as belonging to the transaction. cute, tidy, put it on the list πŸ“‹πŸŒΈ

it returns an error number, or 0 on success β€” so like, 0 = you ate πŸ”₯


πŸ’€ the special-care part (do not skip this one)

special care needs to be taken if the buffer already belongs to the current committing transaction (in which case we should have frozen data present for that commit). 🧊

in that case, we don't relink the buffer β€” that only gets done when the old transaction finally completes its commit. so like, hands off, it's still finishing its thing, let the old transaction have its moment πŸ™ˆ periodt.


🌈 SEE ALSO 🌈

kernel file ./fs/jbd2/transaction.c β€” home of the source material, go read it bestie πŸ“


okay that's the whole page, and yes I'm obsessed with it πŸ’œ sourced from ./fs/jbd2, dated October 2026, and the whole thing is filed under jbd2_journal_dirty_metadata(9) β€” mwah, go journal something, bestie πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from