aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/ops_super.c')
-rw-r--r--fs/gfs2/ops_super.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/fs/gfs2/ops_super.c b/fs/gfs2/ops_super.c
index 0677a8378560..a3c2272e7cad 100644
--- a/fs/gfs2/ops_super.c
+++ b/fs/gfs2/ops_super.c
@@ -121,6 +121,12 @@ static int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
121 return error; 121 return error;
122} 122}
123 123
124static int gfs2_umount_recovery_wait(void *word)
125{
126 schedule();
127 return 0;
128}
129
124/** 130/**
125 * gfs2_put_super - Unmount the filesystem 131 * gfs2_put_super - Unmount the filesystem
126 * @sb: The VFS superblock 132 * @sb: The VFS superblock
@@ -131,6 +137,7 @@ static void gfs2_put_super(struct super_block *sb)
131{ 137{
132 struct gfs2_sbd *sdp = sb->s_fs_info; 138 struct gfs2_sbd *sdp = sb->s_fs_info;
133 int error; 139 int error;
140 struct gfs2_jdesc *jd;
134 141
135 /* Unfreeze the filesystem, if we need to */ 142 /* Unfreeze the filesystem, if we need to */
136 143
@@ -139,9 +146,25 @@ static void gfs2_put_super(struct super_block *sb)
139 gfs2_glock_dq_uninit(&sdp->sd_freeze_gh); 146 gfs2_glock_dq_uninit(&sdp->sd_freeze_gh);
140 mutex_unlock(&sdp->sd_freeze_lock); 147 mutex_unlock(&sdp->sd_freeze_lock);
141 148
149 /* No more recovery requests */
150 set_bit(SDF_NORECOVERY, &sdp->sd_flags);
151 smp_mb();
152
153 /* Wait on outstanding recovery */
154restart:
155 spin_lock(&sdp->sd_jindex_spin);
156 list_for_each_entry(jd, &sdp->sd_jindex_list, jd_list) {
157 if (!test_bit(JDF_RECOVERY, &jd->jd_flags))
158 continue;
159 spin_unlock(&sdp->sd_jindex_spin);
160 wait_on_bit(&jd->jd_flags, JDF_RECOVERY,
161 gfs2_umount_recovery_wait, TASK_UNINTERRUPTIBLE);
162 goto restart;
163 }
164 spin_unlock(&sdp->sd_jindex_spin);
165
142 kthread_stop(sdp->sd_quotad_process); 166 kthread_stop(sdp->sd_quotad_process);
143 kthread_stop(sdp->sd_logd_process); 167 kthread_stop(sdp->sd_logd_process);
144 kthread_stop(sdp->sd_recoverd_process);
145 168
146 if (!(sb->s_flags & MS_RDONLY)) { 169 if (!(sb->s_flags & MS_RDONLY)) {
147 error = gfs2_make_fs_ro(sdp); 170 error = gfs2_make_fs_ro(sdp);