Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1119136ybl; Wed, 4 Dec 2019 17:24:59 -0800 (PST) X-Google-Smtp-Source: APXvYqx9L8lPLvKj5lG4sfd60DK5uFbvvmAjFmf8tCeq2qXjuWp+vjlsSm5HCu1pkDX696xVRtvj X-Received: by 2002:a9d:c29:: with SMTP id 38mr4573420otr.1.1575509099318; Wed, 04 Dec 2019 17:24:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575509099; cv=none; d=google.com; s=arc-20160816; b=OGwuGCESg0XNmrIlFRWqu1l5OLvqbVFGDBLfJYaKtRlvQ1sFiF635COYnPxaBqL7rL 4YTXeYy0xWHTzy8fLrUQilk14VC3ASNKHjXz0x2T3tWkcAagadqgXFCkZbF7hIHLz/IP 4ooyZScceEiKZWjxejJJ0wFvvaaKnzpeeyoWn6B7BheOa6pugYzfO+yCZMUQJsVFrcuL 3dWHneBfP/IoOPFO6FYjE4DPU8hRMJtqdXri442AfAb7HDRXU7/vQU7SUkhZUDKFgnDk 84L2LWOC4U8cDyGBICK6X7qqsHigAhnXv3HApq1rmbP0fg+xeFXeZ/rXdzvWjHQZiPVx 8jtg== 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=zN5sAClH/zVVo4uE0X+fIljrnJUGSZrB4An7Maz/vX8=; b=0+sCdu8mb6Wvjp4kEKIUu0q7XbhSNtj2pf3Q0jpL+8+ghgoBhUtYZVflYzQ2lgWRii 2zQzJZqhQOUc1KAkZjYez4TrziJbyZR5mymP1QG374zckx1U0Mkx2YNEpTjU+33GTrox GJR12wnWs6+PpMGXNSHU5cn69GP9rQJd7OqK2dPPG4bqKn3bUCmGwUQuVdmK/FyJBfaT e7d9+ylcutKKjdJOJYcIIRc8AO4HKiGy4U3Ww7UVkmJm7YACuy0CVFS+l7sENQcbFG0J k7XgA6f0icNZ5DGNU9zy4TGPKqGnkATCHAtf6pKwuR/rRcog7emT3sbXE7tE9Uaafvzj 2K9w== 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 k8si4758696otf.76.2019.12.04.17.24.46; Wed, 04 Dec 2019 17:24:59 -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 S1728011AbfLEBXb (ORCPT + 99 others); Wed, 4 Dec 2019 20:23:31 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:45270 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727146AbfLEBXb (ORCPT ); Wed, 4 Dec 2019 20:23:31 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 86B9320323A9A0248481; Thu, 5 Dec 2019 09:23:29 +0800 (CST) Received: from [127.0.0.1] (10.173.220.179) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Thu, 5 Dec 2019 09:23:20 +0800 Subject: Re: [PATCH v3 3/4] jbd2: make sure ESHUTDOWN to be recorded in the journal superblock To: Jan Kara , CC: , , , , References: <20191204124614.45424-1-yi.zhang@huawei.com> <20191204124614.45424-4-yi.zhang@huawei.com> <20191204170528.GH8206@quack2.suse.cz> From: "zhangyi (F)" Message-ID: <1f8eb86e-53c0-a547-a1e5-b7411d36ac3e@huawei.com> Date: Thu, 5 Dec 2019 09:23:19 +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: <20191204170528.GH8206@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/12/5 1:05, Jan Kara wrote: > On Wed 04-12-19 20:46:13, zhangyi (F) wrote: >> Commit fb7c02445c49 ("ext4: pass -ESHUTDOWN code to jbd2 layer") want >> to allow jbd2 layer to distinguish shutdown journal abort from other >> error cases. So the ESHUTDOWN should be taken precedence over any other >> errno which has already been recoded after EXT4_FLAGS_SHUTDOWN is set, >> but it only update errno in the journal suoerblock now if the old errno >> is 0. >> >> Fixes: fb7c02445c49 ("ext4: pass -ESHUTDOWN code to jbd2 layer") >> Signed-off-by: zhangyi (F) > > Yeah, I think this is correct if I understand the logic correctly but I'd > like Ted to have a look at this. Anyway, feel free to add: > > Reviewed-by: Jan Kara > Thanks for review. Hi Ted, do you have time to look at this patch? Thanks, Yi. > >> --- >> fs/jbd2/journal.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c >> index b2d6e7666d0f..93be6e0311da 100644 >> --- a/fs/jbd2/journal.c >> +++ b/fs/jbd2/journal.c >> @@ -2109,8 +2109,7 @@ static void __journal_abort_soft (journal_t *journal, int errno) >> >> if (journal->j_flags & JBD2_ABORT) { >> write_unlock(&journal->j_state_lock); >> - if (!old_errno && old_errno != -ESHUTDOWN && >> - errno == -ESHUTDOWN) >> + if (old_errno != -ESHUTDOWN && errno == -ESHUTDOWN) >> jbd2_journal_update_sb_errno(journal); >> return; >> } >> -- >> 2.17.2 >>