Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3300001pxk; Mon, 21 Sep 2020 10:02:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2mdSMmO+Vu8+aH9GYdVHpM5JDaj+sfYdOZlGKpsxF1hXniuZsJF/MbCXYAJvAtnWbEXFP X-Received: by 2002:a17:906:2604:: with SMTP id h4mr433172ejc.26.1600707777844; Mon, 21 Sep 2020 10:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600707777; cv=none; d=google.com; s=arc-20160816; b=a0/f9PpJEwOXwJmRnawPKoZiOQWmQc5m2+Gjl3L2cGsNYIaU2rrF793vGMphnTp/rl c1OCQ22EAWg4US1WWKudQHN+FElqneh5yMe3eZLKUv5JgaCck/3a3oisodpbk+FaDQEa LGPQLK7fSWUiNCNmSUgeJH9yLlFEDOFtIG1VwzuW33I3hp8RcbY6dSKxVcmB6V0gAaIC JvqShSc0SsTbTOlbgkCScUSl/o6aEMpEj4jUlwDcDMTYzELxjwjxYM+DGWrcQ/Y43kY1 RcV/SApjy3KMwOgaR/FeBcVfxnq9RBOtsoN5CZluxnSqnahVCVGB//+WDCzEMCI78zvm Yglw== 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=yeksfoj7MVQon9rquc5eTV3/D4ulHqLE8M1YoyywFMQ=; b=ypYFvSjsXWsiuIQ6jddntZIbGrowd85yt1QDvdUsP2d0xhipwnkvLy2pt5mTlYFv97 cnkKpd1ginl/gFP0VgB+EZYEVDfiVszCy+uPqkyw4+EhD6G8fbAtgq0tZd/XhV6TAW62 Fdwf7s4g6Wk17VB2SsTED1Aeah7RqJL02Cyhr7DIjLKpTwNeAxbfF2gLrsUqtbYshuHG jOkYKGM1iv6xYyVK4GBebICqgQSADaHsX+UPfsR094hBDBmVljmqtrrxAm+ZwV7j9+co NlgvSmEELKMuADO3zZMYhTZSYBRNRVWF9b+wjlK2KQi5vAIWZLYckoPobFkTp6uDvjrb Wjag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bSQKzOBm; 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=fail (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 ox9si8543736ejb.97.2020.09.21.10.02.32; Mon, 21 Sep 2020 10:02:57 -0700 (PDT) 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=@kernel.org header.s=default header.b=bSQKzOBm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730360AbgIURAU (ORCPT + 99 others); Mon, 21 Sep 2020 13:00:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:42928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729333AbgIUQkS (ORCPT ); Mon, 21 Sep 2020 12:40:18 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8F9C7206DC; Mon, 21 Sep 2020 16:40:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706418; bh=bIgKcud45TJ9ezMaRGKDFfyhxWAd/pP56z2eojzJ0PU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bSQKzOBm9f9ow1+iDPeWfSkqFzr+6MP6tB8/BhQi2yu98/SBj+wWDeBmVOFgw/F/A 1shgOEEXUY7gU4pyHH3izSUBwMdh9NdqQ92QKATZosW0Qhuq0iifLonH9+sWgnEhr7 rPfClSoXrLMtN5DAoVH8ky5rYimq6akxIlmFZIg0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bob Peterson , Andreas Gruenbacher , Salvatore Bonaccorso Subject: [PATCH 4.14 61/94] gfs2: initialize transaction tr_ailX_lists earlier Date: Mon, 21 Sep 2020 18:27:48 +0200 Message-Id: <20200921162038.353146842@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@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 cbcc89b630447ec7836aa2b9242d9bb1725f5a61 upstream. Since transactions may be freed shortly after they're created, before a log_flush occurs, we need to initialize their ail1 and ail2 lists earlier. Before this patch, the ail1 list was initialized in gfs2_log_flush(). This moves the initialization to the point when the transaction is first created. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher Cc: Salvatore Bonaccorso Signed-off-by: Greg Kroah-Hartman --- fs/gfs2/glops.c | 2 ++ fs/gfs2/log.c | 2 -- fs/gfs2/trans.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -89,6 +89,8 @@ static void gfs2_ail_empty_gl(struct gfs memset(&tr, 0, sizeof(tr)); INIT_LIST_HEAD(&tr.tr_buf); INIT_LIST_HEAD(&tr.tr_databuf); + INIT_LIST_HEAD(&tr.tr_ail1_list); + INIT_LIST_HEAD(&tr.tr_ail2_list); tr.tr_revokes = atomic_read(&gl->gl_ail_count); if (!tr.tr_revokes) --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -734,8 +734,6 @@ void gfs2_log_flush(struct gfs2_sbd *sdp tr = sdp->sd_log_tr; if (tr) { sdp->sd_log_tr = NULL; - INIT_LIST_HEAD(&tr->tr_ail1_list); - INIT_LIST_HEAD(&tr->tr_ail2_list); tr->tr_first = sdp->sd_log_flush_head; if (unlikely (state == SFS_FROZEN)) gfs2_assert_withdraw(sdp, !tr->tr_num_buf_new && !tr->tr_num_databuf_new); --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c @@ -56,6 +56,8 @@ int gfs2_trans_begin(struct gfs2_sbd *sd sizeof(u64)); INIT_LIST_HEAD(&tr->tr_databuf); INIT_LIST_HEAD(&tr->tr_buf); + INIT_LIST_HEAD(&tr->tr_ail1_list); + INIT_LIST_HEAD(&tr->tr_ail2_list); sb_start_intwrite(sdp->sd_vfs);