aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/gfs2/incore.h2
-rw-r--r--fs/gfs2/ops_fstype.c3
-rw-r--r--fs/gfs2/sys.c3
3 files changed, 8 insertions, 0 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 2434a96f95df..67d310c9ada3 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -728,6 +728,8 @@ struct gfs2_sbd {
728 struct gfs2_holder sd_sc_gh; 728 struct gfs2_holder sd_sc_gh;
729 struct gfs2_holder sd_qc_gh; 729 struct gfs2_holder sd_qc_gh;
730 730
731 struct completion sd_journal_ready;
732
731 /* Daemon stuff */ 733 /* Daemon stuff */
732 734
733 struct task_struct *sd_logd_process; 735 struct task_struct *sd_logd_process;
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index be45c79f6745..bc564c0d6d16 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -94,6 +94,7 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)
94 INIT_LIST_HEAD(&sdp->sd_jindex_list); 94 INIT_LIST_HEAD(&sdp->sd_jindex_list);
95 spin_lock_init(&sdp->sd_jindex_spin); 95 spin_lock_init(&sdp->sd_jindex_spin);
96 mutex_init(&sdp->sd_jindex_mutex); 96 mutex_init(&sdp->sd_jindex_mutex);
97 init_completion(&sdp->sd_journal_ready);
97 98
98 INIT_LIST_HEAD(&sdp->sd_quota_list); 99 INIT_LIST_HEAD(&sdp->sd_quota_list);
99 mutex_init(&sdp->sd_quota_mutex); 100 mutex_init(&sdp->sd_quota_mutex);
@@ -796,6 +797,7 @@ static int init_inodes(struct gfs2_sbd *sdp, int undo)
796 goto fail_qinode; 797 goto fail_qinode;
797 798
798 error = init_journal(sdp, undo); 799 error = init_journal(sdp, undo);
800 complete_all(&sdp->sd_journal_ready);
799 if (error) 801 if (error)
800 goto fail; 802 goto fail;
801 803
@@ -1212,6 +1214,7 @@ fail_sb:
1212fail_locking: 1214fail_locking:
1213 init_locking(sdp, &mount_gh, UNDO); 1215 init_locking(sdp, &mount_gh, UNDO);
1214fail_lm: 1216fail_lm:
1217 complete_all(&sdp->sd_journal_ready);
1215 gfs2_gl_hash_clear(sdp); 1218 gfs2_gl_hash_clear(sdp);
1216 gfs2_lm_unmount(sdp); 1219 gfs2_lm_unmount(sdp);
1217fail_debug: 1220fail_debug:
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 7bc17edcb51f..0e049f9574b5 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -407,6 +407,9 @@ int gfs2_recover_set(struct gfs2_sbd *sdp, unsigned jid)
407 struct gfs2_jdesc *jd; 407 struct gfs2_jdesc *jd;
408 int rv; 408 int rv;
409 409
410 /* Wait for our primary journal to be initialized */
411 wait_for_completion(&sdp->sd_journal_ready);
412
410 spin_lock(&sdp->sd_jindex_spin); 413 spin_lock(&sdp->sd_jindex_spin);
411 rv = -EBUSY; 414 rv = -EBUSY;
412 if (sdp->sd_jdesc->jd_jid == jid) 415 if (sdp->sd_jdesc->jd_jid == jid)