wangyan
2020-Feb-06 09:24 UTC
[Ocfs2-devel] [QUESTION] A problem about calling journal flush to mark journal as empty after journal recovery when mount
Hi all, I met a problem when I applied this patch: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_torvalds_linux_commit_397eac17f86f404f5ba31d8c3e39ec3124b39fd3&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=C7gAd4uDxlAvTdc0vmU6X8CMk6L2iDY8-HD0qT6Fo7Y&m=pBBAPX33xxBd2Hct1Bq5-ldWfnb4eARqeSA9CXU2RVM&s=blfDxSr7hVa1lmYYXZ02o5qDEYsSlxZdh2gtolWdrhs&e= It didn't update jbd2 sb log tail when mount as follows: ocfs2_journal_load ->jbd2_journal_load ->journal_reset ->journal->j_tail_sequence = journal->j_transaction_sequence; ->jbd2_journal_flush ->jbd2_cleanup_journal_tail ->jbd2_journal_get_log_tail // if ret is 0, it will return 1 ->*tid = journal->j_transaction_sequence; ->*block = journal->j_head; /* ret is 0 due to "*tid == journal->j_tail_sequence */ ->ret = tid_gt(*tid, journal->j_tail_sequence); ->__jbd2_update_log_tail // cann't not reach this place How does this patch solve the problem mentioned in this patch by calling jbd2_journal_flush? Thanks, Yan Wang
Likai
2020-Feb-06 09:53 UTC
[Ocfs2-devel] [QUESTION] A problem about calling journal flush to mark journal as empty after journal recovery when mount
On 2020/2/6 17:24, wangyan wrote:> Hi all, > > I met a problem when I applied this patch: > https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_torvalds_linux_commit_397eac17f86f404f5ba31d8c3e39ec3124b39fd3&d=DwIFAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=C7gAd4uDxlAvTdc0vmU6X8CMk6L2iDY8-HD0qT6Fo7Y&m=6mOuSCY0uVj1EQsCulE745DiAdBp7k1dPPfLsJC72ws&s=FO5NwgZUjnfd_fnVyVGu8h-qRlrJcjAr7LF6GdbrhHA&e= > > It didn't update jbd2 sb log tail when mount as follows: > ocfs2_journal_load > ->jbd2_journal_load > ->journal_reset > ->journal->j_tail_sequence = journal->j_transaction_sequence; > ->jbd2_journal_flush > ->jbd2_cleanup_journal_tail > ->jbd2_journal_get_log_tail // if ret is 0, it will return 1 > ->*tid = journal->j_transaction_sequence; > ->*block = journal->j_head; > /* ret is 0 due to "*tid == journal->j_tail_sequence */ > ->ret = tid_gt(*tid, journal->j_tail_sequence); > ->__jbd2_update_log_tail // cann't not reach this place > > How does this patch solve the problem mentioned > in this patch by calling jbd2_journal_flush? > > Thanks, > Yan Wang > >jbd2_journal_flush->jbd2_mark_journal_empty will work. Thanks