Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp806239pxb; Tue, 3 Nov 2020 13:03:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxR34OpLNSHdHHLAKBLrO4Y3R+cA8NSsdblimyX8cNudEF9C1aS+OXXv/YJKfVcvl3WWEj2 X-Received: by 2002:a05:6402:17b4:: with SMTP id j20mr11950244edy.24.1604437434545; Tue, 03 Nov 2020 13:03:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437434; cv=none; d=google.com; s=arc-20160816; b=F6qXU5XpB/gnkpEjnfKujODReJMopsuF0yrPVkVeU/TKhwJp5BFtu5tG/nBvGeCTb8 4FBZ4x0YGvtOWQe/T5nB05JtT4hkDv7c9WzvFrB3esrZBiJWQCnQ6218wn9uulKkRESJ 3u3T82lpMVexqsNhzXIa3GHI7NaXmbyKukuRi0tGoTxj6lgXVGkoiuncrtio4KYc5b9W GyNHezTpInMogpDtRF8yRuQ1qadUEo7TSCKy9pPojAsyskvP8/Qvp3Jt4a9ufSYPsFSb rdk7WkLn+p1wC3hocTtzXEQrb6gp3xBg6ZSgtqFJqtwfCAnPGNSlol36ii5u5bNmWHBb IsgA== 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=bWnv096jIUPAYzsk9SFcjKUXr4FXGittiCxJt2aC/Vw=; b=spzIgfFOBbCboYpVQenVwaYLwZcsfg0YIGOtu90AXOM4esK0XeUxOQahB/ILftsf6A plpuDTrV84+q+vHnpiHUqxHivhjM0JDOD3QlWGYlGfT+vGPD4ynLHkxIk9Xotx1vyREM xZG+MPdEAOznhxJHyQuaUfvktws7ObhQNp4qJq6pj2cikXAUhWd+en5C9qTNu0PHIEkx epW6ALXBZvedRqOzDqeBwtbp6CBboev1WF8UGSmnbxuoZikPdb0B907tewiopmBM64Tf lsfxrfydUlvwOLkH8ACn1NiBG/dX4Qk4yF3pEu6HniDOwuYL5Bu7CYmEqENVxFLSZm0F xejA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PHV4gWkc; 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 t20si21203ejj.396.2020.11.03.13.03.31; Tue, 03 Nov 2020 13:03:54 -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=@kernel.org header.s=default header.b=PHV4gWkc; 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 S1733209AbgKCVAR (ORCPT + 99 others); Tue, 3 Nov 2020 16:00:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:35870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733204AbgKCVAO (ORCPT ); Tue, 3 Nov 2020 16:00:14 -0500 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 720B922226; Tue, 3 Nov 2020 21:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437213; bh=RzEuN25/ar48nnIB8Nmiu0Rm9ojCIu5D57M0usXW0lg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PHV4gWkc0U9uY/xVtTJI2uTWMuwQVITL0CSacSKgwqyQ6GFlo/eKKVBDqdtr7K0QR +kJhP0Fy2sGQfJFzCCvxSpbXsef8gNda/miIPYg2WipUyi8tR/ou0+bl53YbGGdJja ovryu8LHhz6zSsmOO9bcLpsWI/Ep96IbcQscTNps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Dinghao Liu , Andreas Dilger , Theodore Tso Subject: [PATCH 5.4 193/214] ext4: fix error handling code in add_new_gdb Date: Tue, 3 Nov 2020 21:37:21 +0100 Message-Id: <20201103203308.745294945@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@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: Dinghao Liu commit c9e87161cc621cbdcfc472fa0b2d81c63780c8f5 upstream. When ext4_journal_get_write_access() fails, we should terminate the execution flow and release n_group_desc, iloc.bh, dind and gdb_bh. Cc: stable@kernel.org Signed-off-by: Dinghao Liu Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/20200829025403.3139-1-dinghao.liu@zju.edu.cn Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/resize.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -861,8 +861,10 @@ static int add_new_gdb(handle_t *handle, BUFFER_TRACE(dind, "get_write_access"); err = ext4_journal_get_write_access(handle, dind); - if (unlikely(err)) + if (unlikely(err)) { ext4_std_error(sb, err); + goto errout; + } /* ext4_reserve_inode_write() gets a reference on the iloc */ err = ext4_reserve_inode_write(handle, inode, &iloc);