public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] jbd2: audit and convert J_ASSERT usage in
@ 2026-03-02 21:34 Milos Nikic
  2026-03-02 21:34 ` [PATCH v2 1/2] jbd2: gracefully abort instead of panicking on unlocked buffer Milos Nikic
  2026-03-02 21:34 ` [PATCH v2 2/2] jbd2: gracefully abort on transaction state corruptions Milos Nikic
  0 siblings, 2 replies; 4+ messages in thread
From: Milos Nikic @ 2026-03-02 21:34 UTC (permalink / raw)
  To: jack; +Cc: tytso, linux-ext4, linux-kernel, Milos Nikic

Hello Jan and the ext4 team,

This patch series follows up on the previous discussion regarding
converting hard J_ASSERT panics into graceful journal aborts.

In v1, we addressed a specific panic on unlock. Per Jan's suggestion,
I have audited fs/jbd2/transaction.c for other low-hanging fruit
where state machine invariants are enforced by J_ASSERT inside
functions that natively support error returns.

Changes in v2:

    Patch 1: The original fix, unmodified. Collected the Reviewed-by
    tags from the v1 thread.

    Patch 2: New patch resulting from the broader audit. It systematically
    replaces J_ASSERTs with WARN_ON_ONCE and graceful -EINVAL returns
    across 6 core transaction lifecycle functions.

For Patch 2, careful attention was paid to ensuring spinlocks are safely
dropped before triggering jbd2_journal_abort(), reference counts
remain balanced, and no memory is leaked on the error paths.

Call-chain tracing confirms that upstream VFS callers (including ext4,
ocfs2, and others) already cleanly intercept these error codes to
abort the filesystem handle rather than crashing the server.

Milos Nikic (2):
  jbd2: gracefully abort instead of panicking on unlocked buffer
  jbd2: gracefully abort on transaction state corruptions

 fs/jbd2/transaction.c | 102 +++++++++++++++++++++++++++++++++---------
 1 file changed, 80 insertions(+), 22 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-02 23:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 21:34 [PATCH v2 0/2] jbd2: audit and convert J_ASSERT usage in Milos Nikic
2026-03-02 21:34 ` [PATCH v2 1/2] jbd2: gracefully abort instead of panicking on unlocked buffer Milos Nikic
2026-03-02 21:34 ` [PATCH v2 2/2] jbd2: gracefully abort on transaction state corruptions Milos Nikic
2026-03-02 23:19   ` Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox