Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2549462pxj; Mon, 10 May 2021 05:42:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5K/WCBEzom0K+rCzRWVy+ieAKoJT0Fz4IUA6TLC7jtve5M4n8j0Bj1n7yUuaqLPcuP7tY X-Received: by 2002:a50:fa44:: with SMTP id c4mr22609788edq.56.1620650568150; Mon, 10 May 2021 05:42:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620650568; cv=none; d=google.com; s=arc-20160816; b=yBFw6oyR+5JR7Rdsq0NtLhMx4PgTffyIjBStrx1BE0ebmkmrvYgTZkpldE9u6cNDkr daymS9oVvMvuCFpWDSdko9TEQP4g0Asr0XlFMGn//+cL6aH84dF4w8ShPKaLR9ubBRcM sL6iilzhUUsUXKMhhljV3xkgZvCUuPwX0gmQNT+9TgH7QzRfUu1iGVbzaXo4i4M6acQP DjSD7GaVn7G0GRGBivtxvVf4DZb4c54wEy0GB7nH7j1yIChqKfFfWVLydrrMJzqYmkmU s7lmVsbTLd/+Sdmm42vymdaKvu7R4w2hbKXpLhZLzbQIt4mfcd5GnAxKh4Xi3Pnavpq2 1Cxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BuNOsl6IDak6UVH5jGeHonYHDmylci5bGTbhGOZS8yo=; b=LAHOPHnEAUEi0sPzPOi3yVNw74bu2F507qRvTgig5ZvzLWtMV/68jJhsS6t9A/VsB5 sTU2XT3wb6F8fjW5pQPLsVxt5B/xA0dqWewXw+UkoVel1EPhcjFe2S+4N1B3NleNmuAq 8Io8ahrJ15f1rzTCVv4YC2Kf1b7NABmK/wFNT/tWR8zej9gGmqZn1OtQRkfkdKlgAkWQ a8onbwnpHOSjKCrE3RLxZFtHMPYYDLTZDxgtI+0eT5+oxrWkNwJ5/jY+mcPJj6iUxpDb BtSQ8rhcV2ij802n1ZiBDybZmFUjjxCz9ksFG06DNUu28CCRdpbcKafbjm9hqnh8OEGO Vk9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r0aSi1tW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si13432622edc.478.2021.05.10.05.42.24; Mon, 10 May 2021 05:42:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r0aSi1tW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345122AbhEJMjd (ORCPT + 99 others); Mon, 10 May 2021 08:39:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:33470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237986AbhEJLQm (ORCPT ); Mon, 10 May 2021 07:16:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6622C61376; Mon, 10 May 2021 11:11:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620645112; bh=U34j+TrFogrOrDROvDuMaPEkYSRCDC3GOxwpZsUAbPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r0aSi1tW5ji9F2jxIKKdjvvQdDrDA3VUqs7zD7zv/C9qsmlRthBdArwbMGVhwnduK 1VYgVCS+RH2c010IaH+LVrK5w+ZTwpCDjACixk0oHCY3u3loFWB3DmLOvW0DOVO5/A lWakT/5EhCMLGtR9D+dHZT4T/mnvaUpQe1w0XV/4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Ye Bin , Theodore Tso Subject: [PATCH 5.12 340/384] ext4: always panic when errors=panic is specified Date: Mon, 10 May 2021 12:22:09 +0200 Message-Id: <20210510102025.987901117@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102014.849075526@linuxfoundation.org> References: <20210510102014.849075526@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ye Bin commit ac2f7ca51b0929461ea49918f27c11b680f28995 upstream. Before commit 014c9caa29d3 ("ext4: make ext4_abort() use __ext4_error()"), the following series of commands would trigger a panic: 1. mount /dev/sda -o ro,errors=panic test 2. mount /dev/sda -o remount,abort test After commit 014c9caa29d3, remounting a file system using the test mount option "abort" will no longer trigger a panic. This commit will restore the behaviour immediately before commit 014c9caa29d3. (However, note that the Linux kernel's behavior has not been consistent; some previous kernel versions, including 5.4 and 4.19 similarly did not panic after using the mount option "abort".) This also makes a change to long-standing behaviour; namely, the following series commands will now cause a panic, when previously it did not: 1. mount /dev/sda -o ro,errors=panic test 2. echo test > /sys/fs/ext4/sda/trigger_fs_error However, this makes ext4's behaviour much more consistent, so this is a good thing. Cc: stable@kernel.org Fixes: 014c9caa29d3 ("ext4: make ext4_abort() use __ext4_error()") Signed-off-by: Ye Bin Link: https://lore.kernel.org/r/20210401081903.3421208-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -667,9 +667,6 @@ static void ext4_handle_error(struct sup ext4_commit_super(sb); } - if (sb_rdonly(sb) || continue_fs) - return; - /* * We force ERRORS_RO behavior when system is rebooting. Otherwise we * could panic during 'reboot -f' as the underlying device got already @@ -679,6 +676,10 @@ static void ext4_handle_error(struct sup panic("EXT4-fs (device %s): panic forced after error\n", sb->s_id); } + + if (sb_rdonly(sb) || continue_fs) + return; + ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only"); /* * Make sure updated value of ->s_mount_flags will be visible before