From patchwork Tue Sep 1 15:10:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 264783 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=-13.0 required=3.0 tests=BAYES_00,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 23F35C433E2 for ; Tue, 1 Sep 2020 15:25:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAE392137B for ; Tue, 1 Sep 2020 15:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598973904; bh=0sF2i8X150aJR9s1ThR83KFzBqql1OUgtwul40T7+EY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=d3nAA0RKpLHDMhXpFxaHa4qHcrHKLe0RSzKBEKU4i+0+z47W+g/dMGXDmZk3rkyeq gxhgzCf07JJjKZaBF0rjnIf5+r/zpEIu0NzP6dedquHX/cGoUkmsZrww2ywNTcZemU A2jI172r7eQLBvVRFB5Gcj9lTeJEe2iVUUX7Q4o4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729992AbgIAPZC (ORCPT ); Tue, 1 Sep 2020 11:25:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:49116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729988AbgIAPZA (ORCPT ); Tue, 1 Sep 2020 11:25:00 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 04F5D2137B; Tue, 1 Sep 2020 15:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598973899; bh=0sF2i8X150aJR9s1ThR83KFzBqql1OUgtwul40T7+EY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ognpi+EeNs8KjRP/TGPamf7rJOoFyWckovLL+qU2C59p79jkO1bb0bLnSpvp63sgp R8TW+nDzrKvJHEdlOG16rzfQXqp64AT0hyvUwkSOh2l8ocydy/7lPIDvptDUPo1V65 RCp/GhN2DAHmQM0uRicxBCSQ19KoY20hLLYnS3ls= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lukas Czerner , Jan Kara , Theodore Tso , Sasha Levin Subject: [PATCH 4.19 064/125] ext4: handle error of ext4_setup_system_zone() on remount Date: Tue, 1 Sep 2020 17:10:19 +0200 Message-Id: <20200901150937.714785240@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150934.576210879@linuxfoundation.org> References: <20200901150934.576210879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jan Kara [ Upstream commit d176b1f62f242ab259ff665a26fbac69db1aecba ] 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 Signed-off-by: Sasha Levin --- 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 03ebb0b385467..daabd7a2cee81 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5470,7 +5470,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 & SB_RDONLY)) { err = ext4_commit_super(sb, 1); if (err)