Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp273952ybg; Mon, 1 Jun 2020 00:35:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysU1lvpwsiEYXGGmRH6gwx6HYp3+2MXRuNcVo+OJ9RS8JM2SW7iwR8zNpTOpWiZOCy93PU X-Received: by 2002:a05:6402:17ce:: with SMTP id s14mr3727404edy.53.1590996928957; Mon, 01 Jun 2020 00:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590996928; cv=none; d=google.com; s=arc-20160816; b=CUTvi/GyybyI8e2bd0TeiztW9XX/vTb6vtf4BxFToRMLEJrTC5TC0Q0pMcQfCtP4Ns Kz0TxRnave/x0+7qA/wCWM5IMUzatgWEij2vwlQC/n6/2+i5PhPbdPTzXXSIn/CbwhEi dU0YDCQ8r80wy4LbCf1c4HcAHJz88CaA4sU+0rUk0mzXUgBIgZohLiP5O+5qOzq9akn/ HhXUB/1JHVkL1BLcswmX1hJpvtNcFY7JYDXGnmQP6rt7jpLDyLJGW/jszgSRho00MuzI Go9g1Ra91JvuoV9qaRxStasUXX9O/WRSYBUTPSXVsXzsekoqn5dHc4bulD/3wNZWx++4 +7tg== 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:mime-version :message-id:date:subject:cc:to:from; bh=qrbpiDlvzRnogEzUEFd4BAkzWnjh1iMHoWEQPRpfezs=; b=00UYqWwHCwda/qTbqOx3C7jC/9KnvRKa9TL/Snd1TQ6qdtLHzcLZYfJ6HYmfSIinLz 8DBWhc6L7l+gXBgEpOA7I1nrcvSxacrkk8U/uSHV0hN+FLwQD2be1Kyp/0+RvTp8xoim Q841xs2R8Niy0y9eM1LLHMRYSNYNQ20aP+XBGWlBdiu/RvKKyhjL0iWpdqyuaZ00ai/t p/TAM7u5Dq55MdIqj6FmKtYb7d+zdeChccjCFCrWzBDKitG4b4mseZBHmLEF57JyQy2y G2gHze9ot4Bc3ISp3ok35JpnERS6PgDoKE9L1y804nPAbyOsBqBS+XB99QXOdwCOLhnM KdYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 z9si1845450ejm.47.2020.06.01.00.34.59; Mon, 01 Jun 2020 00:35:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727124AbgFAHeh (ORCPT + 99 others); Mon, 1 Jun 2020 03:34:37 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:45694 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726860AbgFAHeh (ORCPT ); Mon, 1 Jun 2020 03:34:37 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7821477F46E464539ED2; Mon, 1 Jun 2020 15:34:35 +0800 (CST) Received: from code-website.localdomain (10.175.104.175) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Mon, 1 Jun 2020 15:34:27 +0800 From: yangerkun To: , , CC: , , Subject: [PATCH] ext4: stop overwrite the errcode in ext4_setup_super Date: Mon, 1 Jun 2020 15:34:04 +0800 Message-ID: <20200601073404.3712492-1-yangerkun@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Now the errcode from ext4_commit_super will overwrite EROFS exists in ext4_setup_super. Actually, no need to call ext4_commit_super since we will return EROFS. Fix it by goto done directly. Fixes: c89128a00838 ("ext4: handle errors on ext4_commit_super") Signed-off-by: yangerkun --- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index bf5fcb477f66..87c5611a4c67 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2344,6 +2344,7 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, ext4_msg(sb, KERN_ERR, "revision level too high, " "forcing read-only mode"); err = -EROFS; + goto done; } if (read_only) goto done; -- 2.25.4