From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] GFS2: mark the journal idle to fix ro mounts
Date: Mon, 27 Apr 2015 11:01:42 +0100 [thread overview]
Message-ID: <553E0906.6000708@redhat.com> (raw)
In-Reply-To: <1429888385-25449-1-git-send-email-bmarzins@redhat.com>
Hi,
On 24/04/15 16:13, Benjamin Marzinski wrote:
> When gfs2 was mounted read-only and then unmounted, it was writing a
> header block to the journal in the syncing gfs2_log_flush() call from
> kill_sb(). This is because the journal was not being marked as idle
> until the first log header was written out, and on a read-only mount
> there never was a log header written out. Since the journal was not
> marked idle, gfs2_log_flush() was writing out a header lock to make
> sure it was empty during the sync. Not only did this cause IO to a
> read-only filesystem, but the journalling isn't completely initialized
> on read-only mounts, and so gfs2 was writing out the wrong sequence
> number in the log header.
>
> Now, the journal is marked idle on mount, and gfs2_log_flush() won't
> write out anything until there starts being transactions to flush.
Does that mean that we should be doing more to initialize the log in the
r/o mount case? It should know enough to recover the journals in the
case that it is the first mounter, so did this perhaps only apply to
subsequent mounters of the filesystem?
Still it is a good catch!
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Steve.
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
> fs/gfs2/ops_fstype.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
> index 8633ad3..fd984f6 100644
> --- a/fs/gfs2/ops_fstype.c
> +++ b/fs/gfs2/ops_fstype.c
> @@ -757,6 +757,7 @@ static int init_journal(struct gfs2_sbd *sdp, int undo)
> }
> }
>
> + sdp->sd_log_idle = 1;
> set_bit(SDF_JOURNAL_CHECKED, &sdp->sd_flags);
> gfs2_glock_dq_uninit(&ji_gh);
> jindex = 0;
next prev parent reply other threads:[~2015-04-27 10:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-24 15:13 [Cluster-devel] [PATCH] GFS2: mark the journal idle to fix ro mounts Benjamin Marzinski
2015-04-24 20:18 ` Bob Peterson
2015-04-27 10:01 ` Steven Whitehouse [this message]
2015-04-27 17:31 ` Benjamin Marzinski
2015-04-28 9:44 ` Steven Whitehouse
2015-05-01 14:45 ` Bob Peterson
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=553E0906.6000708@redhat.com \
--to=swhiteho@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).