From: jiangyiwen <jiangyiwen@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: clear journal dirty flag after shutdown journal
Date: Mon, 19 Nov 2018 10:28:54 +0800 [thread overview]
Message-ID: <5BF21FE6.5030509@huawei.com> (raw)
In-Reply-To: <20181116085847.10066-1-junxiao.bi@oracle.com>
On 2018/11/16 16:58, Junxiao Bi wrote:
> Dirty flag of the journal should be cleared at the last stage of umount,
> if do it before jbd2_journal_destroy(), then some metadata in uncommitted
> transaction could be lost due to io error, but as dirty flag of journal
> was already cleared, we can't find that until run a full fsck. This may
> cause system panic or other corruption.
>
> Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
> ---
> fs/ocfs2/journal.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
> index b63c97f4318e..25d678c92fbb 100644
> --- a/fs/ocfs2/journal.c
> +++ b/fs/ocfs2/journal.c
> @@ -1017,6 +1017,10 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
> mlog_errno(status);
> }
>
> + /* Shutdown the kernel journal system */
> + jbd2_journal_destroy(journal->j_journal);
> + journal->j_journal = NULL;
> +
Hi Junxiao,
I feel this adjustment doesn't make any sense. When jbd2_journal_destroy() is
done, it still call ocfs2_journal_toggle_dirty() to clean dirty flag. Am I
wrong or understand error ?
Thanks.
Yiwen.
> if (status == 0) {
> /*
> * Do not toggle if flush was unsuccessful otherwise
> @@ -1027,10 +1031,6 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
> mlog_errno(status);
> }
>
> - /* Shutdown the kernel journal system */
> - jbd2_journal_destroy(journal->j_journal);
> - journal->j_journal = NULL;
> -
> OCFS2_I(inode)->ip_open_count--;
>
> /* unlock our journal */
>
next prev parent reply other threads:[~2018-11-19 2:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 8:58 [Ocfs2-devel] [PATCH] ocfs2: clear journal dirty flag after shutdown journal Junxiao Bi
2018-11-19 1:32 ` piaojun
2018-11-19 1:45 ` Junxiao Bi
2018-11-19 2:28 ` jiangyiwen [this message]
2018-11-19 2:43 ` Junxiao Bi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5BF21FE6.5030509@huawei.com \
--to=jiangyiwen@huawei.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.