aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
authorBenjamin Marzinski <bmarzins@redhat.com>2015-12-09 08:46:33 -0500
committerBob Peterson <rpeterso@redhat.com>2015-12-14 13:19:41 -0500
commit400ac52e805bb6852e743817bc05a136e85042a9 (patch)
tree2876b8f8f47852207eed3ad9d6bb02030744e6b3 /fs/gfs2/super.c
parent471f3db2786bc32011d6693413eb93b0c3da2579 (diff)
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>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r--fs/gfs2/super.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 0f3d64606e93..1e7da3886254 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -851,10 +851,6 @@ static int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
851 gfs2_quota_sync(sdp->sd_vfs, 0); 851 gfs2_quota_sync(sdp->sd_vfs, 0);
852 gfs2_statfs_sync(sdp->sd_vfs, 0); 852 gfs2_statfs_sync(sdp->sd_vfs, 0);
853 853
854 down_write(&sdp->sd_log_flush_lock);
855 clear_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
856 up_write(&sdp->sd_log_flush_lock);
857
858 gfs2_log_flush(sdp, NULL, SHUTDOWN_FLUSH); 854 gfs2_log_flush(sdp, NULL, SHUTDOWN_FLUSH);
859 wait_event(sdp->sd_reserving_log_wait, atomic_read(&sdp->sd_reserving_log) == 0); 855 wait_event(sdp->sd_reserving_log_wait, atomic_read(&sdp->sd_reserving_log) == 0);
860 gfs2_assert_warn(sdp, atomic_read(&sdp->sd_log_blks_free) == sdp->sd_jdesc->jd_blocks); 856 gfs2_assert_warn(sdp, atomic_read(&sdp->sd_log_blks_free) == sdp->sd_jdesc->jd_blocks);