Revert "ocfs2: fix null-ptr-deref when journal load failed."

This reverts commit e7014629c9.
This commit is contained in:
Ksawlii 2024-11-24 00:23:02 +01:00
parent d751cc7fe8
commit 25c64d5629

View file

@ -996,7 +996,7 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
if (!igrab(inode))
BUG();
num_running_trans = atomic_read(&(journal->j_num_trans));
num_running_trans = atomic_read(&(osb->journal->j_num_trans));
trace_ocfs2_journal_shutdown(num_running_trans);
/* Do a commit_cache here. It will flush our journal, *and*
@ -1015,10 +1015,9 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
osb->commit_task = NULL;
}
BUG_ON(atomic_read(&(journal->j_num_trans)) != 0);
BUG_ON(atomic_read(&(osb->journal->j_num_trans)) != 0);
if (ocfs2_mount_local(osb) &&
(journal->j_journal->j_flags & JBD2_LOADED)) {
if (ocfs2_mount_local(osb)) {
jbd2_journal_lock_updates(journal->j_journal);
status = jbd2_journal_flush(journal->j_journal);
jbd2_journal_unlock_updates(journal->j_journal);