Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp726433pxv; Thu, 1 Jul 2021 08:01:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxg44l97UrHGsq5zkjOSPxoHX6G8tt/k8EuB9HKv5o8HxDemkkqrNMi5w1i/VZIbSV7tRDM X-Received: by 2002:a05:6402:1a34:: with SMTP id be20mr371294edb.106.1625151699976; Thu, 01 Jul 2021 08:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625151699; cv=none; d=google.com; s=arc-20160816; b=RTa/rkhnqbP4SvebLAAKCgnJajBTLpbMgX3Hp4vMNbATYdmdX+hCBDMev50HkBMBPY +J1IbbfTcCEnnOkrMxzn5oeUPmjm0e05Y32ELdBdu9PCzWgXoxWpDg43acJeLBbcmAC1 1EFZZBKhpq0jsjtHEy0ocHSUHlTRliP8zh8M16D73gPi29JYLv98frqlqGW56Z2gPbsr VAaht7bmq2IzP6uuiHpAOFp4K0fe8KIQ5I1ERC6nbK6nRJ/mhtIhtPM6tX10PBEqAjgW LzLaBqtMX7VjTMTTxN7V2UbSWJYVqKxzEIfUdZe/lgdLN97Tx3KnDthwSLjQcS8h6IQl okbQ== 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=UKoRI6FHSPPuMPN8k3KilnEEFD4e81sFjYEPUDQRyOA=; b=cxdV/6kzdy04hQuj+pukuHf1Mmyko5HDP8tuZ6CMN9odaFPpVwPgulnX7mRsja6DrI TEnz8KxFC5KDCP8J3XfS3fxIQhgwbfr3WttmzaaJcX9vuu6NLt+3Z0AF/RW049pmbVxv I85aC7ExmQcJNrhTm9l8+CeXVjDSzQfTeCSNh3zW9YLy5K0rnFXBFDigADMp8ngjXCp6 fxaQd63Fb2RHSUrkLmS945fa407JPdqrX/JDmmrmWhcvbwImPFCsdnSTJ7cCayFaW63m wfxGIPkaGxm3F+OHkFrTIDNerMWM7vlWuBt4n9DmnYoAajBN6f+M/6QmcCJdWDx58M9Y BJcA== 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 v8si2139edt.425.2021.07.01.08.01.11; Thu, 01 Jul 2021 08:01:39 -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 S233194AbhGAPCN (ORCPT + 99 others); Thu, 1 Jul 2021 11:02:13 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:57061 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233009AbhGAPCN (ORCPT ); Thu, 1 Jul 2021 11:02:13 -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 161ExTM8001736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Jul 2021 10:59:30 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id CD4D415C3CE1; Thu, 1 Jul 2021 10:59:29 -0400 (EDT) Date: Thu, 1 Jul 2021 10:59:29 -0400 From: "Theodore Ts'o" To: Ye Bin Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, jack@suse.cz Subject: Re: [PATCH RFC v2] ext4:fix warning in mark_buffer_dirty as IO error when mount with errors=continue Message-ID: References: <20210615090537.3423231-1-yebin10@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210615090537.3423231-1-yebin10@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Thanks, applied. I reworded the commit description a bit, putting the explanation first, and cleaning up the text a bit to make it more readable: commit 558d6450c7755aa005d89021204b6cdcae5e848f Author: Ye Bin Date: Tue Jun 15 17:05:37 2021 +0800 ext4: fix WARN_ON_ONCE(!buffer_uptodate) after an error writing the superblock If a writeback of the superblock fails with an I/O error, the buffer is marked not uptodate. However, this can cause a WARN_ON to trigger when we attempt to write superblock a second time. (Which might succeed this time, for cerrtain types of block devices such as iSCSI devices over a flaky network.) Try to detect this case in flush_stashed_error_work(), and also change __ext4_handle_dirty_metadata() so we always set the uptodate flag, not just in the nojournal case. Before this commit, this problem can be repliciated via: 1. dmsetup create dust1 --table '0 2097152 dust /dev/sdc 0 4096' 2. mount /dev/mapper/dust1 /home/test 3. dmsetup message dust1 0 addbadblock 0 10 4. cd /home/test 5. echo "XXXXXXX" > t After a few seconds, we got following warning: ...