Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp410793ybg; Mon, 1 Jun 2020 04:49:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1qszz2V17GFRhMXtoAq6CjaU89B5n0fyRonca3g+NpXMGzTv6tp/NfQzJZf0eoG6jt8r8 X-Received: by 2002:a50:cc85:: with SMTP id q5mr17823097edi.62.1591012186407; Mon, 01 Jun 2020 04:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591012186; cv=none; d=google.com; s=arc-20160816; b=CoQsdHmyxGB7M4T3TVCbKt6Ja2/SDLGmDws4yyybOj0CXoxng6VLGzLFcv01vyrspn QQSvXX84fwPVd/wVVZzvmPU1N156iLgmmPZNESsWmrFt3grNU7czmwHh7t9Cg7xdy6mi dUSuzyaodUJJsQyNgAM6kBfB2VkQICcxKXsLPwlhO9rLRC7Rvb3A+nSrrJqEfeQ4/jTm V05u82b31JbiHLKJnXCiCtbW++2ONf/5jbhj/rREFgHu3iliCofS7dP3ARJ7H05k2FlI 7k0wjdVIuZhmktS1B316kIkR8UxA/1IbsAQCn8xS/wfkaitUW71FVZdm0OtBtfPQVqQK /qlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9D3zZGXM+FQ9xCv26aWL0lwRE43CCGKHi/Xu2CeogH8=; b=WRSROMtTTriaY2IJgL98a+5W6M8iVSGzsltJD59WiNYVznf51G8ptHUJ2fXgw5FTKe 91paEgV0TFHezgZmql76vAy8XZ0wK2gJmX0P632+1+Owhsy/+jdvyLYThMTjyBx53CY6 U96Qdfqt/k4qKPOm1125f39RVkw9sI9thbCa9Hb2QiUfgP9VAI7Xos7AWTUBjShMEdtp aWWUHOvASGk190JqVpqYbZTTFQk7xkd855QsEkCx2F/ev5H34XozlrIMZ20eZrjvtEKN 0kZjCA+54BYEJOQ1L+EfbZbIyHGRJsUXaaEF2nZfzPfFIpavdAVl5WLyZS35dIp9iE71 6ElQ== 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 j21si8780425ejc.497.2020.06.01.04.49.22; Mon, 01 Jun 2020 04:49:46 -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 S1726110AbgFALrL (ORCPT + 99 others); Mon, 1 Jun 2020 07:47:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:32902 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbgFALrK (ORCPT ); Mon, 1 Jun 2020 07:47:10 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8FF8DAD5F; Mon, 1 Jun 2020 11:47:11 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id F12771E0948; Mon, 1 Jun 2020 13:47:08 +0200 (CEST) Date: Mon, 1 Jun 2020 13:47:08 +0200 From: Jan Kara To: yangerkun Cc: tytso@mit.edu, jaegeuk@kernel.org, jack@suse.cz, linux-ext4@vger.kernel.org, yi.zhang@huawei.com Subject: Re: [PATCH] ext4: stop overwrite the errcode in ext4_setup_super Message-ID: <20200601114708.GG3960@quack2.suse.cz> References: <20200601073404.3712492-1-yangerkun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200601073404.3712492-1-yangerkun@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon 01-06-20 15:34:04, yangerkun wrote: > 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 Yeah, makes sense. You can add: Reviewed-by: Jan Kara Honza > --- > 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 > -- Jan Kara SUSE Labs, CR