From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4161C433DF for ; Tue, 23 Jun 2020 20:33:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F4452098B for ; Tue, 23 Jun 2020 20:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944417; bh=mWRcGJcFpdspk9lG5U62Wl6ugJkfkAO+IylRgcep8NU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XsyvoFudccITPZe44G0z9zneZ2+78dTmXDjLdBxdliAasKTnXV3+6/StkerTdEUfi zE2/wx/6q+GFst//7YLw1+5rJKmeXBUDES/z/gQBREgb8uakZRhxih9BMaAjz6x+5k xTxaHS3jZzg/jgxT7n2UQfMhRNlPrYVpSj6DuDXM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391433AbgFWUdf (ORCPT ); Tue, 23 Jun 2020 16:33:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:54996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391430AbgFWUde (ORCPT ); Tue, 23 Jun 2020 16:33:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 CC56521473; Tue, 23 Jun 2020 20:33:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944414; bh=mWRcGJcFpdspk9lG5U62Wl6ugJkfkAO+IylRgcep8NU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XiCEAAmhU8R6hodBh7E8dBMTQwvjEvINwcCamHrkldHjsWBQdQGbxwFgKYGgTPPuM ALVrywTuRbzK0Nz3u5Z5K0uNlql1w9SO51VDma9KP1tsJkMHwJRkOHILfLguMR2uWV jb6ebZC9kOlk6Bg7X6g8K7j9TFLg8R4J86mY7XM8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, yangerkun , Jan Kara , Theodore Tso , Sasha Levin Subject: [PATCH 5.4 265/314] ext4: stop overwrite the errcode in ext4_setup_super Date: Tue, 23 Jun 2020 21:57:40 +0200 Message-Id: <20200623195351.615450117@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195338.770401005@linuxfoundation.org> References: <20200623195338.770401005@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: yangerkun [ Upstream commit 5adaccac46ea79008d7b75f47913f1a00f91d0ce ] 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 Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20200601073404.3712492-1-yangerkun@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index d3500eaf900e2..830160ad07a63 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2294,6 +2294,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.1