Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2067159pxa; Mon, 24 Aug 2020 04:19:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2B8sm+qLDicBUpXAYljfOSoLpBqpnEq/WqYQjDXyuPI6O+l+GeTQTDblSkMDLssck9a9u X-Received: by 2002:a17:906:f24c:: with SMTP id gy12mr4903244ejb.275.1598267952512; Mon, 24 Aug 2020 04:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598267952; cv=none; d=google.com; s=arc-20160816; b=wW9YZCEpuab6NfGMAqPvPrlNdYTDF/umkxB7O1bPhETc007zxsrxIaRhai1PPyUiM2 MUOw2BJ2U7DtB1Smwz7CK3M+tBlVg4VSzogQojVxaKXxi5Z6d4FEsWOP0NCceCysypgk UomGVXLBlA7oX1/ULYEkZ3XAjOwOCchuFwJW7PCG27S2U6EBCBNJadyth/zX0ZcyxSs7 4y8pkQP2Epu79yzfubVz6t/PX/CbBCFP0xxqj4WQKl23gFUqsPQLhASIaaC3XAJC1ueh x63IWtlScyQkPk6rJaODmEtDp/DNbyJGbXd4MUombgkcp0WKwV6KA4+4VimBbGnIW4lW sWFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=oQTenORDsI2fiVKl0n9xSerUoLScPVLWELFzFQM6EJA=; b=O+BMXGl+MTwv16QjXEyfj8gP3d3q39pqz632KOgFzS89RCCw2dP92GvYVXD1wDCh9a b1+KjXCmAtrCgkC1dEfHlhz2cNYnK82lRd9irWlG5GPhK/ORvWeEm9RIAfLa0MFsgu+a OUs7LUDBljzbtrc6fBVXOR9KezkJub88ssbRSpQ/WpoXM5JpFdjhUuDwovk4P2zdtPsI yWZRjAircYnHpKMjYRmhETigDZpwj4LICExWvxVbWjUBVmWyxDqfwzxpRWoW+NSZV3uV mJkemAw3wl/CmtLpPYfZm+zCitU3OSXInDisMUr6aOxsHIlSIR7KLlzTeUxWkVMGcDRm M62g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u1si6357668eda.219.2020.08.24.04.18.48; Mon, 24 Aug 2020 04:19:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726704AbgHXLRm (ORCPT + 99 others); Mon, 24 Aug 2020 07:17:42 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10260 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725946AbgHXLPo (ORCPT ); Mon, 24 Aug 2020 07:15:44 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E98ABA15FF03CF7F0D60; Mon, 24 Aug 2020 19:15:29 +0800 (CST) Received: from [127.0.0.1] (10.174.179.187) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 24 Aug 2020 19:15:26 +0800 Subject: Re: [PATCH 4.9 15/39] jbd2: add the missing unlock_buffer() in the error path of jbd2_write_superblock() To: Greg Kroah-Hartman , CC: , Ritesh Harjani , , Theodore Tso References: <20200824082348.445866152@linuxfoundation.org> <20200824082349.270439673@linuxfoundation.org> From: "zhangyi (F)" Message-ID: <72009693-6c2a-df4f-f93a-31b5924e7790@huawei.com> Date: Mon, 24 Aug 2020 19:15:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20200824082349.270439673@linuxfoundation.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.187] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hiļ¼ŒGreg The problem this patch want to fix only exists on the kernel both 538bcaa6261b and 742b06b5628f these two upstream patches were merged, but 538bcaa6261b was not merged to 4.9, so we don't need this patch for 4.9. Thanks, Yi. On 2020/8/24 16:31, Greg Kroah-Hartman wrote: > From: zhangyi (F) > > commit ef3f5830b859604eda8723c26d90ab23edc027a4 upstream. > > jbd2_write_superblock() is under the buffer lock of journal superblock > before ending that superblock write, so add a missing unlock_buffer() in > in the error path before submitting buffer. > > Fixes: 742b06b5628f ("jbd2: check superblock mapped prior to committing") > Signed-off-by: zhangyi (F) > Reviewed-by: Ritesh Harjani > Cc: stable@kernel.org > Link: https://lore.kernel.org/r/20200620061948.2049579-1-yi.zhang@huawei.com > Signed-off-by: Theodore Ts'o > Signed-off-by: Greg Kroah-Hartman > > --- > fs/jbd2/journal.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > --- a/fs/jbd2/journal.c > +++ b/fs/jbd2/journal.c > @@ -1340,8 +1340,10 @@ static int jbd2_write_superblock(journal > int ret; > > /* Buffer got discarded which means block device got invalidated */ > - if (!buffer_mapped(bh)) > + if (!buffer_mapped(bh)) { > + unlock_buffer(bh); > return -EIO; > + } > > trace_jbd2_write_superblock(journal, write_flags); > if (!(journal->j_flags & JBD2_BARRIER)) > > > > . >