cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] fs: Fix bug in gfs2_freeze_func that can cause deadlock
Date: Mon, 3 Jul 2023 22:31:34 +0200	[thread overview]
Message-ID: <CAHc6FU71+Y2CT=04cbgtxp5p8jPYU5RK0tcz8wR4jyLdQw6h4A@mail.gmail.com> (raw)
In-Reply-To: <20230620033859.997-1-lidong@vivo.com>

Li Dong,

On Tue, Jun 20, 2023 at 5:47?AM Li Dong <lidong@vivo.com> wrote:
> Function gfs2_freeze_func causes a deadlock?because sd_freeze_mutex was
> not released when return
>
> Signed-off-by: Li Dong <lidong@vivo.com>
> ---
>  fs/gfs2/super.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -741,8 +741,10 @@ void gfs2_freeze_func(struct work_struct *work)
>         set_bit(SDF_FROZEN, &sdp->sd_flags);
>
>         error = gfs2_do_thaw(sdp);
> -       if (error)
> +       if (error) {
> +               mutex_unlock(&sdp->sd_freeze_mutex);
>                 goto out;
> +       }

thank you for this bug report. I have chosen to fold this fix into
commit "gfs2: Rework freeze / thaw logic" and clean up
gfs2_freeze_func() a little along the way; see the current for-next
branch.

Thanks,
Andreas

>         clear_bit(SDF_FROZEN, &sdp->sd_flags);
>
> --
> 2.31.1.windows.1


      reply	other threads:[~2023-07-03 20:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20  3:38 [Cluster-devel] [PATCH] fs: Fix bug in gfs2_freeze_func that can cause deadlock Li Dong
2023-07-03 20:31 ` 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='CAHc6FU71+Y2CT=04cbgtxp5p8jPYU5RK0tcz8wR4jyLdQw6h4A@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 read-only IMAP folder(s) and NNTP newsgroup(s).