lkml.org 
[lkml]   [2023]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] fs: Fix bug in gfs2_freeze_func that can cause deadlock
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

\
 
 \ /
  Last update: 2023-07-03 22:33    [W:0.033 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site