Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp482956pxb; Wed, 3 Mar 2021 08:01:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2nnTxe/VHwTUgLo8N0g4lrdJNVW1Am7oM1Iv98PAWP1HUbc6bSFd+gCcYZpABO94F8LWJ X-Received: by 2002:a19:46:: with SMTP id 67mr15774327lfa.327.1614787274014; Wed, 03 Mar 2021 08:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614787273; cv=none; d=google.com; s=arc-20160816; b=t84ikmBkKt9/u3mU7Ty8jI1HPXvPNTelrCwOpoKINuEUpfam5Ucg1AqVwx0aRRQKMZ AUX1B94dLkLEVItUgTOf+c7HPdhe6QLOCrmkoSEBZgJn55ga+7RJ9ttuNQVc0kREWMd0 vgISeDhvEUA+CHfKVoxjLElRs3I+FYEHtlKKWoEpH/KZLp1iXfwnbW+1cP7mXkTeINj5 Ef+LDgYPvd5q2CLsul60jiPKrJJ/e46vUpx5sO4FB2FHDDpOy6MyunoqwSMDesh9Dvv4 zLwdMpxjfKIpmFPqigYjwZlvqU6A6wOqJi7ZF1C78NsegAIQ/EdDPvH9rh2LMf4gFIZT LEcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dayLlTFSIMHpQiOgFMwu+rh4x5Br/Huc7drTdWNVQyY=; b=K1n+FzP8ITwUopmh7yM0mwiM02o58arEKtGS4KnQnt9Nnm7ID1ouVKTsTDpmUlYpzF vNYfKIkt9kQreC0L4Z7niepItYvoWlE06N5wOt7ef9D4AwM8aGBbtw6fdPG0Ei61Opxn Qx8tm9TvVk/NuZiluPf2+mtbeTr5DC4YwNihnk2xYRg3Pf98fPiRiA5aInBOBmG3YgmB VFHfhQakq+cPm+TmPco7OvuLRCuXEVB+SIr4zVrLPGc7/WO2SyRuoFqu1DJG1owYcxCQ s2u0pZOZ1c1G2H1Bi3NjYuDKut/UnkVyk/J3ruuYPnRyHQJhbNnMUj/ig+owZJxYvXc2 F4/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o2bEX8YE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k9si14552271ejc.706.2021.03.03.08.00.32; Wed, 03 Mar 2021 08:01:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o2bEX8YE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344998AbhCAXKX (ORCPT + 99 others); Mon, 1 Mar 2021 18:10:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:49710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238873AbhCAR4Z (ORCPT ); Mon, 1 Mar 2021 12:56:25 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EA8CD65292; Mon, 1 Mar 2021 17:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619941; bh=TFqIPdUDjPW5xQIl2D2AAy/slzU2IEd+9FSUAXhCuK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o2bEX8YEC21KcWjxG3NRsoaovAE82mPH/a2hwrrZgvSfdvW+d9iRlsYvMoqvXaF2M ONmdZNtswjewkRUf7EIfk0o8PTSc2alVdxC/iglJsWLgMJi3W7pB+DKUFFM7oc6t5l O9SejuzjZ4/8M/If9RaxbApgSR0UHGjYy0BsfKo8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Peterson Subject: [PATCH 5.10 637/663] gfs2: fix glock confusion in function signal_our_withdraw Date: Mon, 1 Mar 2021 17:14:45 +0100 Message-Id: <20210301161213.372258109@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bob Peterson commit f5f02fde9f52b2d769c1c2ddfd3d9c4a1fe739a7 upstream. If go_free is defined, function signal_our_withdraw is supposed to synchronize on the GLF_FREEING flag of the inode glock, but it accidentally does that on the live glock. Fix that and disambiguate the glock variables. Fixes: 601ef0d52e96 ("gfs2: Force withdraw to replay journals and wait for it to finish") Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: Bob Peterson Signed-off-by: Greg Kroah-Hartman --- fs/gfs2/util.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) --- a/fs/gfs2/util.c +++ b/fs/gfs2/util.c @@ -93,9 +93,10 @@ out_unlock: static void signal_our_withdraw(struct gfs2_sbd *sdp) { - struct gfs2_glock *gl = sdp->sd_live_gh.gh_gl; + struct gfs2_glock *live_gl = sdp->sd_live_gh.gh_gl; struct inode *inode = sdp->sd_jdesc->jd_inode; struct gfs2_inode *ip = GFS2_I(inode); + struct gfs2_glock *i_gl = ip->i_gl; u64 no_formal_ino = ip->i_no_formal_ino; int ret = 0; int tries; @@ -141,7 +142,8 @@ static void signal_our_withdraw(struct g atomic_set(&sdp->sd_freeze_state, SFS_FROZEN); thaw_super(sdp->sd_vfs); } else { - wait_on_bit(&gl->gl_flags, GLF_DEMOTE, TASK_UNINTERRUPTIBLE); + wait_on_bit(&i_gl->gl_flags, GLF_DEMOTE, + TASK_UNINTERRUPTIBLE); } /* @@ -161,15 +163,15 @@ static void signal_our_withdraw(struct g * on other nodes to be successful, otherwise we remain the owner of * the glock as far as dlm is concerned. */ - if (gl->gl_ops->go_free) { - set_bit(GLF_FREEING, &gl->gl_flags); - wait_on_bit(&gl->gl_flags, GLF_FREEING, TASK_UNINTERRUPTIBLE); + if (i_gl->gl_ops->go_free) { + set_bit(GLF_FREEING, &i_gl->gl_flags); + wait_on_bit(&i_gl->gl_flags, GLF_FREEING, TASK_UNINTERRUPTIBLE); } /* * Dequeue the "live" glock, but keep a reference so it's never freed. */ - gfs2_glock_hold(gl); + gfs2_glock_hold(live_gl); gfs2_glock_dq_wait(&sdp->sd_live_gh); /* * We enqueue the "live" glock in EX so that all other nodes @@ -208,7 +210,7 @@ static void signal_our_withdraw(struct g gfs2_glock_nq(&sdp->sd_live_gh); } - gfs2_glock_queue_put(gl); /* drop the extra reference we acquired */ + gfs2_glock_queue_put(live_gl); /* drop extra reference we acquired */ clear_bit(SDF_WITHDRAW_RECOVERY, &sdp->sd_flags); /*