gfs2: clear journal live bit in gfs2_log_flush
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 9 Dec 2015 13:46:33 +0000 (07:46 -0600)
committerBob Peterson <rpeterso@redhat.com>
Mon, 14 Dec 2015 18:19:41 +0000 (12:19 -0600)
commit400ac52e805bb6852e743817bc05a136e85042a9
tree2876b8f8f47852207eed3ad9d6bb02030744e6b3
parent471f3db2786bc32011d6693413eb93b0c3da2579
gfs2: clear journal live bit in gfs2_log_flush

When gfs2 was unmounting filesystems or changing them to read-only it
was clearing the SDF_JOURNAL_LIVE bit before the final log flush.  This
caused a race.  If an inode glock got demoted in the gap between
clearing the bit and the shutdown flush, it would be unable to reserve
log space to clear out the active items list in inode_go_sync, causing an
error in inode_go_inval because the glock was still dirty.

To solve this, the SDF_JOURNAL_LIVE bit is now cleared inside the
shutdown log flush.  This means that, because of the locking on the log
blocks, either inode_go_sync will be able to reserve space to clean the
glock before the shutdown flush, or the shutdown flush will clean the
glock itself, before inode_go_sync fails to reserve the space. Either
way, the glock will be clean before inode_go_inval.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/log.c
fs/gfs2/super.c
This page took 0.025193 seconds and 5 git commands to generate.