From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] gfs2: Register fs after creating workqueues
Date: Tue, 20 Sep 2022 18:01:30 +0200 [thread overview]
Message-ID: <CAHc6FU4Wb9+JM6ZMgqVpQgEYFZS9YFZW3s-cSNOMF7-5FXbPqw@mail.gmail.com> (raw)
In-Reply-To: <20220830185213.77259-1-rpeterso@redhat.com>
On Tue, Aug 30, 2022 at 8:52 PM Bob Peterson <rpeterso@redhat.com> wrote:
> 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>
> ---
> fs/gfs2/main.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
> index 14ae9de76277..afcb32854f14 100644
> --- a/fs/gfs2/main.c
> +++ b/fs/gfs2/main.c
> @@ -151,14 +151,6 @@ static int __init init_gfs2_fs(void)
> if (error)
> 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;
> gfs_recovery_wq = alloc_workqueue("gfs_recovery",
> WQ_MEM_RECLAIM | WQ_FREEZABLE, 0);
> @@ -180,11 +172,23 @@ static int __init init_gfs2_fs(void)
> goto fail_mempool;
>
> 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");
>
> return 0;
>
> +fail_fs2:
> + unregister_filesystem(&gfs2_fs_type);
> +fail_fs1:
> + mempool_destroy(gfs2_page_pool);
> fail_mempool:
> destroy_workqueue(gfs2_freeze_wq);
> fail_wq3:
> @@ -192,10 +196,6 @@ static int __init init_gfs2_fs(void)
> fail_wq2:
> destroy_workqueue(gfs_recovery_wq);
> fail_wq1:
> - unregister_filesystem(&gfs2meta_fs_type);
> -fail_fs2:
> - unregister_filesystem(&gfs2_fs_type);
> -fail_fs1:
> unregister_shrinker(&gfs2_qd_shrinker);
> fail_shrinker:
> kmem_cache_destroy(gfs2_trans_cachep);
> --
> 2.37.2
>
Pushed to for-next.
Thanks,
Andreas
prev parent reply other threads:[~2022-09-20 16:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 18:52 [Cluster-devel] [PATCH] gfs2: Register fs after creating workqueues Bob Peterson
2022-09-20 16:01 ` Andreas Gruenbacher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHc6FU4Wb9+JM6ZMgqVpQgEYFZS9YFZW3s-cSNOMF7-5FXbPqw@mail.gmail.com \
--to=agruenba@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).