Commit 74b1b10e authored by Bob Peterson's avatar Bob Peterson Committed by Andreas Gruenbacher

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: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 670f8ce5
...@@ -151,14 +151,6 @@ static int __init init_gfs2_fs(void) ...@@ -151,14 +151,6 @@ static int __init init_gfs2_fs(void)
if (error) if (error)
goto fail_shrinker; goto fail_shrinker;
error = register_filesystem(&gfs2_fs_type);
if (error)
goto fail_fs1;
error = register_filesystem(&gfs2meta_fs_type);
if (error)
goto fail_fs2;
error = -ENOMEM; error = -ENOMEM;
gfs_recovery_wq = alloc_workqueue("gfs_recovery", gfs_recovery_wq = alloc_workqueue("gfs_recovery",
WQ_MEM_RECLAIM | WQ_FREEZABLE, 0); WQ_MEM_RECLAIM | WQ_FREEZABLE, 0);
...@@ -180,11 +172,23 @@ static int __init init_gfs2_fs(void) ...@@ -180,11 +172,23 @@ static int __init init_gfs2_fs(void)
goto fail_mempool; goto fail_mempool;
gfs2_register_debugfs(); gfs2_register_debugfs();
error = register_filesystem(&gfs2_fs_type);
if (error)
goto fail_fs1;
error = register_filesystem(&gfs2meta_fs_type);
if (error)
goto fail_fs2;
pr_info("GFS2 installed\n"); pr_info("GFS2 installed\n");
return 0; return 0;
fail_fs2:
unregister_filesystem(&gfs2_fs_type);
fail_fs1:
mempool_destroy(gfs2_page_pool);
fail_mempool: fail_mempool:
destroy_workqueue(gfs2_freeze_wq); destroy_workqueue(gfs2_freeze_wq);
fail_wq3: fail_wq3:
...@@ -192,10 +196,6 @@ static int __init init_gfs2_fs(void) ...@@ -192,10 +196,6 @@ static int __init init_gfs2_fs(void)
fail_wq2: fail_wq2:
destroy_workqueue(gfs_recovery_wq); destroy_workqueue(gfs_recovery_wq);
fail_wq1: fail_wq1:
unregister_filesystem(&gfs2meta_fs_type);
fail_fs2:
unregister_filesystem(&gfs2_fs_type);
fail_fs1:
unregister_shrinker(&gfs2_qd_shrinker); unregister_shrinker(&gfs2_qd_shrinker);
fail_shrinker: fail_shrinker:
kmem_cache_destroy(gfs2_trans_cachep); kmem_cache_destroy(gfs2_trans_cachep);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment