From patchwork Wed Mar 17 16:44:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 403926 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 B0ECCC433E6 for ; Wed, 17 Mar 2021 16:44:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E45764F7B for ; Wed, 17 Mar 2021 16:44:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232288AbhCQQoX (ORCPT ); Wed, 17 Mar 2021 12:44:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:32930 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232574AbhCQQoU (ORCPT ); Wed, 17 Mar 2021 12:44:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4742EAE15; Wed, 17 Mar 2021 16:44:19 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id E8D201E11DB; Wed, 17 Mar 2021 17:44:18 +0100 (CET) From: Jan Kara To: Greg Kroah-Hartman Cc: , Jan Kara , Lukas Czerner , Theodore Ts'o Subject: [PATCH stable 4.14.y 1/3] ext4: handle error of ext4_setup_system_zone() on remount Date: Wed, 17 Mar 2021 17:44:12 +0100 Message-Id: <20210317164414.17364-2-jack@suse.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210317164414.17364-1-jack@suse.cz> References: <20210317164414.17364-1-jack@suse.cz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org commit d176b1f62f242ab259ff665a26fbac69db1aecba upstream. ext4_setup_system_zone() can fail. Handle the failure in ext4_remount(). Reviewed-by: Lukas Czerner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20200728130437.7804-2-jack@suse.cz Signed-off-by: Theodore Ts'o --- fs/ext4/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index eaa8bcd59b6a..8e6178dc0e6e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5364,7 +5364,10 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) ext4_register_li_request(sb, first_not_zeroed); } - ext4_setup_system_zone(sb); + err = ext4_setup_system_zone(sb); + if (err) + goto restore_opts; + if (sbi->s_journal == NULL && !(old_sb_flags & MS_RDONLY)) ext4_commit_super(sb, 1);