Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2490772pxj; Mon, 10 May 2021 04:22:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzg6ViKTzq9IWI7WSjNf39kxLPryXDRRpzkwmSLsUVx3d2ffb6t5/TAVNSdGxeSG8T2sC0i X-Received: by 2002:a17:906:a887:: with SMTP id ha7mr24843796ejb.365.1620645749125; Mon, 10 May 2021 04:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645749; cv=none; d=google.com; s=arc-20160816; b=CxFNxLG0bENJFHr1xVqtvT5/yFZ5Lkfx7YYrE5tR7ilTSmfiFVv5P3kEiuH12OEsSt GESKBXreMeMvjmOGHsLEHnNXFBDz8AA0Jj61CQV1W/0o3/sBffD6PpzCQRW1rA18PgtV 95Xt0MyYsWxSlaN5LwtuUmt6WOpSD4oEy/icJAVaP+D9unwBibv5PRVNk3Xh4x5btrxy kylE0ONqlAf5UEVhoBISvGFDSBT/lSsjs27BgnmirrzrtGO6TnMisI7UnDJYYyRhdEoS KdSoGRbCeHGFCrpZEKwr8NK0QHAH7r/+OXb/2IA5VHl1o7IiSbcWg6NpS1gINM0oNnmu wDSQ== 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=Oskbw1wbL5088Rpyb3+CkBXJTnX6xs6bpMenAMkWtls=; b=nbfOeQM+k4RBd+frebv3svN/SMrQwFSZkhIkEPZG7nl/MJUGqXh/FzkWMZ0mL+Sy/0 8dbgsyDUmbidI5Wl82Itjp5IpMhhNuCffpgTlbbOOAAdsdAVsTcS1Vov8qLmQqysEZad 7du5NupEh3LefS5uhIkgQNHZBG/GzBHZEyUTD/44P4StGzXMSWS76Be6Rk2ECpD4lXm5 sicwwb2vWSSTwHqiy5fwzwOTzyBtIW9biSZJ3/MYxQV1JzUPk36dSUVKD4wu7/H+3bgA YBsdt+T+lw71lhN03FPCKMI2rhXSqUJ61S67nMr2RzAa1ZL5rD/CteXVrCN3K3Ljy2Ku k0yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FYfnl2f6; 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 pg2si13458514ejb.495.2021.05.10.04.22.04; Mon, 10 May 2021 04:22:29 -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=@linuxfoundation.org header.s=korg header.b=FYfnl2f6; 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 S239039AbhEJLU4 (ORCPT + 99 others); Mon, 10 May 2021 07:20:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:52794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234055AbhEJKzu (ORCPT ); Mon, 10 May 2021 06:55:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 41D1A6197C; Mon, 10 May 2021 10:43:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643418; bh=SUOhekehMWqrzICfDRCMSIHJvDJWvem14upZemA+pWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FYfnl2f6WzAuDzfGxkse1CKXRkINrEJnuQLBiskE+WO3CjslZrv33eMzJt5Wh7DZR KsGicIdyVV3paYAeaXwdIyMHqqB5SOggwZz2+AAdfenNm3WuVdI+zSSnp49rEh+ywQ 49trYob0IicoATwp7+X8PPS+XPIxClG1HpQXzTGs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Hulk Robot , Xu Yihang , Harshad Shirwadkar , Theodore Tso Subject: [PATCH 5.10 270/299] ext4: fix error return code in ext4_fc_perform_commit() Date: Mon, 10 May 2021 12:21:07 +0200 Message-Id: <20210510102013.849671585@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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: Xu Yihang commit e1262cd2e68a0870fb9fc95eb202d22e8f0074b7 upstream. In case of if not ext4_fc_add_tlv branch, an error return code is missing. Cc: stable@kernel.org Fixes: aa75f4d3daae ("ext4: main fast-commit commit path") Reported-by: Hulk Robot Signed-off-by: Xu Yihang Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20210408070033.123047-1-xuyihang@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/fast_commit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -1032,8 +1032,10 @@ static int ext4_fc_perform_commit(journa head.fc_tid = cpu_to_le32( sbi->s_journal->j_running_transaction->t_tid); if (!ext4_fc_add_tlv(sb, EXT4_FC_TAG_HEAD, sizeof(head), - (u8 *)&head, &crc)) + (u8 *)&head, &crc)) { + ret = -ENOSPC; goto out; + } } spin_lock(&sbi->s_fc_lock);