Skip to content

Commit 74b1b10

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: Register fs after creating workqueues
Before this patch, the gfs2 file system was registered prior to creating the three workqueues. In some cases this allowed dlm to send recovery work to a workqueue that did not yet exist because gfs2 was still initializing. This patch changes the order of gfs2's initialization routine so it only registers the file system after the work queues are created. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 670f8ce commit 74b1b10

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

fs/gfs2/main.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,6 @@ static int __init init_gfs2_fs(void)
151151
if (error)
152152
goto fail_shrinker;
153153

154-
error = register_filesystem(&gfs2_fs_type);
155-
if (error)
156-
goto fail_fs1;
157-
158-
error = register_filesystem(&gfs2meta_fs_type);
159-
if (error)
160-
goto fail_fs2;
161-
162154
error = -ENOMEM;
163155
gfs_recovery_wq = alloc_workqueue("gfs_recovery",
164156
WQ_MEM_RECLAIM | WQ_FREEZABLE, 0);
@@ -180,22 +172,30 @@ static int __init init_gfs2_fs(void)
180172
goto fail_mempool;
181173

182174
gfs2_register_debugfs();
175+
error = register_filesystem(&gfs2_fs_type);
176+
if (error)
177+
goto fail_fs1;
178+
179+
error = register_filesystem(&gfs2meta_fs_type);
180+
if (error)
181+
goto fail_fs2;
182+
183183

184184
pr_info("GFS2 installed\n");
185185

186186
return 0;
187187

188+
fail_fs2:
189+
unregister_filesystem(&gfs2_fs_type);
190+
fail_fs1:
191+
mempool_destroy(gfs2_page_pool);
188192
fail_mempool:
189193
destroy_workqueue(gfs2_freeze_wq);
190194
fail_wq3:
191195
destroy_workqueue(gfs2_control_wq);
192196
fail_wq2:
193197
destroy_workqueue(gfs_recovery_wq);
194198
fail_wq1:
195-
unregister_filesystem(&gfs2meta_fs_type);
196-
fail_fs2:
197-
unregister_filesystem(&gfs2_fs_type);
198-
fail_fs1:
199199
unregister_shrinker(&gfs2_qd_shrinker);
200200
fail_shrinker:
201201
kmem_cache_destroy(gfs2_trans_cachep);

0 commit comments

Comments
 (0)