Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1667879pxf; Fri, 9 Apr 2021 14:29:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgVdC/a/NQj5Hd7n+2T2IIJtHgvqOWxCvUD9euCLfB2keikcOkneIXJU34+Lqj3kgv0XYx X-Received: by 2002:a05:6402:105a:: with SMTP id e26mr19259716edu.164.1618003797105; Fri, 09 Apr 2021 14:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618003797; cv=none; d=google.com; s=arc-20160816; b=HEa69TJznkZSXLh8Wb3l3B2KQlujU8AXLnXR9vrEHFwrB9G9ta4D8cYX5PgydkIfvU Nwh62UffUzr5/MtQTaYF1RfhwXQ+tDYHNZOGRKHSGCY9aDo4ffuAmiUav1c9lkagbrRh 9YzBE++qCbWASo2TEv9+Pvdo8sY/Z3L7sDbrsUE7czBKGxphEJXmIGdvLdsYF+wbn/dm 1dk4sRTc59LyuuO55q6s4u714kT7h4r9/Yh2bnVo8NzKnLs6AhPbqh21qTWvnt/XJj6S A5kBLeLH/1KBw53ZJM+UnSjqSKC0nAwkuk06BAvpEOSSKAI+62RuwwcxeULe9JZ5cpGG eJGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=y7sGsISMSQC7hNcou9bp0TyPfrVpB0bIvWTGHflA7Vw=; b=xrwXNoZyh84bCekZjQtt+I09Yd0iqYXo4nlRoEwdaKBHGyNeXV2UJKqTLsCCciJoVf 2gfRCfO17d9ntRdZxni2m2DcGGXTilQBkF637QIdcoUV9vPY0bQTdLczVEwabW/VvPtR QC70UyX1H1VyyouMTUjH9YSxt7A+zNbhGI2RA5JGnBa2lfowoPJqviLKXzDXtaTShUdD 17lFFh1fsCYQgrdeplO63MfCWiT+1pX6/VD2L2v2eajtUFyhK5CSYWl+cLPIL7l562+F XkErtYL32fKrRIaoMLVTeLOuEjQW2vlIA2afHtEoCWSU/hZHqS56Yp0atnOEc6tM5DIQ bN4w== 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 gr2si2681722ejb.65.2021.04.09.14.29.27; Fri, 09 Apr 2021 14:29:57 -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 S234416AbhDIV3S (ORCPT + 99 others); Fri, 9 Apr 2021 17:29:18 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:47402 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234333AbhDIV3R (ORCPT ); Fri, 9 Apr 2021 17:29:17 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 139LSsO7004914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 9 Apr 2021 17:28:55 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 787AA15C3B12; Fri, 9 Apr 2021 17:28:54 -0400 (EDT) Date: Fri, 9 Apr 2021 17:28:54 -0400 From: "Theodore Ts'o" To: Ye Bin Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] ext4: Fix fs can't panic when abort by user Message-ID: References: <20210401081903.3421208-1-yebin10@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210401081903.3421208-1-yebin10@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Apr 01, 2021 at 04:19:03PM +0800, Ye Bin wrote: > Test steps: > 1. mount /dev/sda -o errors=panic test > 2. mount /dev/sda -o remount,ro test > 3. mount /dev/sda -o remount,abort test > > Before 014c9caa29d3 not been merged there will trigger panic. But > 014c9caa29d3 change this behavior. This makes sense, but I'll note this behavior has changed over time. root@kvm-xfstests:~# mount -o errors=panic /dev/vdc /vdc [ 20.252713] EXT4-fs (vdc): mounted filesystem with ordered data mode. Opts: errors=panic root@kvm-xfstests:~# mount -o remount,ro /dev/vdc [ 24.832448] EXT4-fs (vdc): re-mounted. Opts: (null) root@kvm-xfstests:~# mount -o remount,abort /dev/vdc [ 30.833543] EXT4-fs error (device vdc): ext4_remount:5340: Abort forced by user mount: /vdc: cannot remount /dev/vdc read-write, is write-protected. root@kvm-xfstests:~# mount -o remount,abort,ro /dev/vdc [ 34.545549] EXT4-fs error (device vdc): ext4_remount:5340: Abort forced by user [ 34.555475] EXT4-fs (vdc): re-mounted. Opts: abort root@kvm-xfstests:~# uname -a Linux kvm-xfstests 4.19.163-xfstests #1 SMP Sat Dec 19 23:55:11 EST 2020 x86_64 GNU/Linux root@kvm-xfstests:~# The same is true for the 5.4 kernel. I do agree that it *should* force a panic, and the fact that superblock is read-only shouldn't make a difference as to how errors=panic is handled. So I think the patch is correct, but I'll note that it also changes this case: 1) mount -o /dev/sda -o ro,errors=panic test 2) echo test > /sys/fs/ext4/sda/trigger_fs_error With this patch, this will also now panic, whereas before, an ext4_error() would not trigger a panic. I think that's better because it makes things more consistent --- but it is a change in behavior which could potentially surprise some people. But since they can easily get the previous behavior with an explicit "mount -o ro,errors=continue", I think that's acceptable. I'll apply the patch with a modified commit description to warn of this particular change in behavior. - Ted