Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8899536ybc; Fri, 29 Nov 2019 19:25:41 -0800 (PST) X-Google-Smtp-Source: APXvYqyccwSifD/8ugGiOIqe90EJQzc+pvbzgGVYyB/7HKJiZU6uCzwBZvvJCfTgXoaROuY/APdm X-Received: by 2002:a50:f299:: with SMTP id f25mr17906408edm.280.1575084341074; Fri, 29 Nov 2019 19:25:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575084341; cv=none; d=google.com; s=arc-20160816; b=lY+ALUSI/SdVI3qIeABGxQs7ngeLkj2oOAnISK/kbHnb+fb7MXvkEDLv0ALkUnBziQ fHdUtDY4CvM9uQfX9zZfCueYlQOQIXgioZbKxvFEuNG+cQ5SHaNA4rnvPYAbjD4wvfmB EHYEcfM5mk4BLAFi5Pw8zQvdplxbPhlhpOG2bVjcHNvxSg3jIeX1niS29285Is8vm+W0 CMGXGAWjrgLKrkm2b1i0nThzUigfsuR3XA9hOMitscuZL4cwzHaOxvo+3q3z2a0SyDZS OipregkQhJLv2tlCoYxgtR0doVFTHZ8VZhdcXMV1TLJFOfvrF8tINCMzW0To8Yu9TRdq I2UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8sBUGpRyVlWfpPnzrvSFQ7UjVVlgAhHifXUksFY4lTo=; b=ns2QyqPErL/s7ehlo2Eqpgp5y8eqanRoglvjSTCx7g4rGWWGv18ARWEKuw5LPROQcN 0hmwm56yoBdh3yO4PLFaridSl+KijNUIks3RSnYwPiGQxMcvilAjMMb2pySfDqSGQ/5b 0i5f0kflcjGuWE80Ro1E5MSPEPkKnfU3JSKo3p7aIiE6mgkM+ofJF6XHe/qRMPGQbzBU SVLfPCB5n/aM5DuE2WyRPHiLA60aehKCqiHrX+5XSmxQxAZeFXhWYPBPeB5FVd9VUiiZ wLmyVeLYzdMCOfQY9rbe4thgtvZ8OD9YNIhwtDZ8bi7DAwX/HYy2q74/tnddS8ibUvGc XtTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si7372254ejq.151.2019.11.29.19.25.01; Fri, 29 Nov 2019 19:25:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727175AbfK3DZA (ORCPT + 99 others); Fri, 29 Nov 2019 22:25:00 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:6735 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727142AbfK3DZA (ORCPT ); Fri, 29 Nov 2019 22:25:00 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9375F60AD524312AAD6B; Sat, 30 Nov 2019 11:24:58 +0800 (CST) Received: from [127.0.0.1] (10.173.220.179) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Sat, 30 Nov 2019 11:24:49 +0800 Subject: Re: [PATCH] ext4, jbd2: ensure panic when there is no need to record errno in the jbd2 sb To: Jan Kara CC: , , , , References: <20191126144537.30020-1-yi.zhang@huawei.com> <20191129144611.GA27588@quack2.suse.cz> From: "zhangyi (F)" Message-ID: <0aa529fe-a881-aa4c-3b8f-980c8eceb64b@huawei.com> Date: Sat, 30 Nov 2019 11:24:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191129144611.GA27588@quack2.suse.cz> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.173.220.179] X-CFilter-Loop: Reflected Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 2019/11/29 22:46, Jan Kara wrote: > On Tue 26-11-19 22:45:37, zhangyi (F) wrote: >> JBD2_REC_ERR flag used to indicate the errno has been updated when jbd2 >> aborted, and then __ext4_abort() and ext4_handle_error() can invoke >> panic if ERRORS_PANIC is specified. But there is one exception, if jbd2 >> thread failed to submit commit record, it abort journal through >> invoking __jbd2_journal_abort_hard() without set this flag, so we can >> no longer panic. Fix this by set such flag even if there is no need to >> record errno in the jbd2 super block. >> >> Fixes: 4327ba52afd03 ("ext4, jbd2: ensure entering into panic after recording an error in superblock") >> Signed-off-by: zhangyi (F) >> Cc: > > Thanks for the patch. This indeed looks like a bug. I was trying hard to > understand why are we actually using __jbd2_journal_abort_hard() in > fs/jbd2/commit.c in the first place. And after some digging, I think it is > an oversight and we should just use jbd2_journal_abort(). The calls have been > introduced by commit 818d276ceb83a "ext4: Add the journal checksum > feature". Before that commit, we were just using jbd2_journal_abort() when > writing commit block failed. And when we use jbd2_journal_abort() from > everywhere, that will also deal with the problem you've found. > > Also as a nice cleanup we could then just drop __jbd2_journal_abort_hard(), > __jbd2_journal_abort_soft() and have all the functionality in a single > function jbd2_journal_abort(). > Indeed, it seems that we also need to record the errno if we failed to submit commit block, I will remove __jbd2_journal_abort_hard() and combine them in my next iteration. Thanks, Yi.