]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - fs/gfs2/ops_fstype.c
GFS2: mark the journal idle to fix ro mounts
authorBenjamin Marzinski <bmarzins@redhat.com>
Fri, 1 May 2015 14:36:00 +0000 (09:36 -0500)
committerBob Peterson <rpeterso@redhat.com>
Fri, 1 May 2015 14:36:00 +0000 (09:36 -0500)
commit086cc672e1cb600b9c17688a4aa44560db858c03
tree314f310ad31531e19adeaae83e126a80d6a3f7c6
parent0166b197c2ed2327bb7761ded8cba2cfd371a425
GFS2: mark the journal idle to fix ro mounts

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.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/ops_fstype.c