[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251112102914.82278-1-liubaolin12138@163.com>
Date: Wed, 12 Nov 2025 18:29:14 +0800
From: Baolin Liu <liubaolin12138@....com>
To: tytso@....edu,
jack@...e.com
Cc: linux-ext4@...r.kernel.org,
linux-kernel@...r.kernel.org,
Baolin Liu <liubaolin@...inos.cn>
Subject: [PATCH v1] jbd2: use J_ASSERT instead of BUG_ON for checkpoint mutex
From: Baolin Liu <liubaolin@...inos.cn>
Replace BUG_ON with J_ASSERT to write the assertion in a positive form.
No functional change.
Signed-off-by: Baolin Liu <liubaolin@...inos.cn>
---
fs/jbd2/journal.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index d480b94117cd..c858ade1f7f3 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1058,7 +1058,7 @@ int __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block)
unsigned long freed;
int ret;
- BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
+ J_ASSERT(mutex_is_locked(&journal->j_checkpoint_mutex));
/*
* We cannot afford for write to remain in drive's caches since as
@@ -1863,7 +1863,7 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid,
return -EIO;
}
- BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
+ J_ASSERT(mutex_is_locked(&journal->j_checkpoint_mutex));
jbd2_debug(1, "JBD2: updating superblock (start %lu, seq %u)\n",
tail_block, tail_tid);
@@ -1897,7 +1897,7 @@ static void jbd2_mark_journal_empty(journal_t *journal, blk_opf_t write_flags)
journal_superblock_t *sb = journal->j_superblock;
bool had_fast_commit = false;
- BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
+ J_ASSERT(mutex_is_locked(&journal->j_checkpoint_mutex));
lock_buffer(journal->j_sb_buffer);
if (sb->s_start == 0) { /* Is it already empty? */
unlock_buffer(journal->j_sb_buffer);
--
2.39.2
Powered by blists - more mailing lists