Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp309914pxj; Thu, 20 May 2021 09:49:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZgxSnV0cs9uCASZJl8Orn8U3haEo3YS+hvrzkyQqwjgDbhAxCd+AZFtwTsfHKp624GEMB X-Received: by 2002:a17:907:a06d:: with SMTP id ia13mr5735237ejc.484.1621529362273; Thu, 20 May 2021 09:49:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529362; cv=none; d=google.com; s=arc-20160816; b=l9JVSfvD3Wd8u08CdV5ya2fkDdL2PY6fTr9ZtC5oKOPX95Uczs3CPpRWoKpDn5hrV+ b7U74MvHEKTtqSsHFWm3FI89wgj5SnmHGM/+QGNifnCMYmsjYKflQd1bdPuTY4W3391u 93pePPY1D7Gs3ifOOl+l11zqRw8G90kzub9eurJ0/4VUBPCJc61TkLfqpEf4/6pz52GP kRaMYhiltWuAvhDNk4ltLVmJgwabEJiB5WFjGcaMA2/76dXvBh3XvSO90dfwLvt4sDQ0 QqXNV8Ar7MEQDOLTyvsAggo/SFOv4nmmUviqaXfFKyVdWVqCJXee7V5qNWxUIVR1TU02 /bnA== 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=c35ai1xDU5tT+CS2Vqlx8dICKb/OtM0vNVPtNbpSIbU=; b=GXUFXjGAlowIZwO1XZIoFT6bqGaFJ838/xvFO6lPNUf04jdfvFKXUy1VBMZdELZBTB pvYTwGC/Bl1lg9eRgKVCSMk7jXjKI3TXGTL0LEJBLc3ifi+N9zplSr+Kf2mkXAyrHmPb FXWh7nCzJBEYHoQL1YIt5S/30xWxyU47JxLYTpD5xXDcrr6LTdmzepoQKHFaUurNA6FE 20klFcCTat6MO65iOAHkV90Jk0fySasZvDj1VCD6fCHcd34GgWjeSJovYUd849p/Zggc ckdB0/CxBgz72YoS95bGX3UaA0VIf8dg3gabWuWF850kkeff4QIFsE3zisIuK0h9Ry+S JtZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BmA+5Xd/"; 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 gv3si3579895ejc.220.2021.05.20.09.48.59; Thu, 20 May 2021 09:49:22 -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="BmA+5Xd/"; 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 S233788AbhETJu4 (ORCPT + 99 others); Thu, 20 May 2021 05:50:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:47676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234005AbhETJsR (ORCPT ); Thu, 20 May 2021 05:48:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9244C61463; Thu, 20 May 2021 09:34:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503279; bh=uUXiwfOMzlvElhZWi2sX9iR9N7fdnUSfJYbgvbQblHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BmA+5Xd/kn2Fst3+lQ39ubr5bUVquci2YhUa70VU33qw3PaOddJXmDUzXCVs8nx+T XMtYpQUe1LMb2SY1MAkJiXhMQgpDkqIpL1KFb2fari1YsfXkRquiAbGh/C984PH5gi /xKeTy+QpOU2jzOR0k/e27L/RItKGKaQXVeZBDWk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Fengnan Chang , Andreas Dilger , Theodore Tso Subject: [PATCH 4.19 105/425] ext4: fix error code in ext4_commit_super Date: Thu, 20 May 2021 11:17:54 +0200 Message-Id: <20210520092134.909598110@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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: Fengnan Chang commit f88f1466e2a2e5ca17dfada436d3efa1b03a3972 upstream. We should set the error code when ext4_commit_super check argument failed. Found in code review. Fixes: c4be0c1dc4cdc ("filesystem freeze: add error handling of write_super_lockfs/unlockfs"). Cc: stable@kernel.org Signed-off-by: Fengnan Chang Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/20210402101631.561-1-changfengnan@vivo.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4959,8 +4959,10 @@ static int ext4_commit_super(struct supe struct buffer_head *sbh = EXT4_SB(sb)->s_sbh; int error = 0; - if (!sbh || block_device_ejected(sb)) - return error; + if (!sbh) + return -EINVAL; + if (block_device_ejected(sb)) + return -ENODEV; /* * If the file system is mounted read-only, don't update the