Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp429392ybl; Wed, 11 Dec 2019 21:52:45 -0800 (PST) X-Google-Smtp-Source: APXvYqwkwko0+EesEQeIkdmhLyytuySMyoAhGyYc8AnhFXYxkZbxat3no8H+cCojelfO8EeFwF9s X-Received: by 2002:a9d:7cd9:: with SMTP id r25mr5890399otn.326.1576129965387; Wed, 11 Dec 2019 21:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576129965; cv=none; d=google.com; s=arc-20160816; b=BO8Vm8V4E3+3u8epuhqyF0hISvpuHG+FR8h5BgZ2MlMpE/jfK8dkScXPX3LxjRf+jl zEwFMUNHwo4yGeuPNOD8mNslNGDIoA/ZBbKs5vmxRsblD+d+gDUCSI7Fagx7Hqqghyr6 52SXFMmTKiM74UNO9mjPiOiy/U2A6LvCBIP5aBqxoJnKdSo7FoYRYFP5+X6YQSAP5NCG zLHbUT3vOYbURW1wKc8RrX35sq3ivELSDr2xMPAs0Lp2hloSP/+xnzbJm2OU4EJvQP5T r0PUZ9RdPbOvPFDqAh1pHLMA2eKxDNP/PwHmTUXJcBhcLIG5o6Ium4ispuNym8avmJGO zQ3g== 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=hDIPkHag9gdoKdu07cLx3Mq9eDN6BLulYVf0yzAlaGI=; b=mwLegeWhwE+P1PtV2uw68DkSmD6Jre/ZsGT9sh/uWzE0AtpdHMUMsIPq0vulm+nyEw 6wT7EfY/FtV8uPTTt/3oPfhswXnQZPw+qk7r//BImqF9CAsVUtJyrwTaVm9Bcu7sZenl H6Gy5kCtqOB8OuACI/0wZ50q3l14tuFl/51yGhRdvJO3OcmHs+a0kpWzMEKbXDORdhKw 7JmIhLecjs1xwFz87/BwCNV/N4vFOVBngrF5nd/GdG4alG45QFdp5H0f3F7ygrh4zLDa 1cGI9kDFHzTNKDS/oBwi4r8YvYXvHztym7AxHxmhSUCwO8tIAQvRZ2zGZTKDy/nhFzkq 87zA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si2539883otk.171.2019.12.11.21.52.32; Wed, 11 Dec 2019 21:52:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbfLLFwA (ORCPT + 99 others); Thu, 12 Dec 2019 00:52:00 -0500 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:10721 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbfLLFv7 (ORCPT ); Thu, 12 Dec 2019 00:51:59 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0TkgNfek_1576129906; Received: from JosephdeMacBook-Pro.local(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0TkgNfek_1576129906) by smtp.aliyun-inc.com(127.0.0.1); Thu, 12 Dec 2019 13:51:47 +0800 Subject: Re: [PATCH] ocfs2: call journal flush to mark journal as empty after journal recovery when mount To: Changwei Ge , Kai Li , mark@fasheh.com, jlbec@evilplan.org Cc: ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org References: <20191211100338.510-1-li.kai4@h3c.com> <76d8166c-afe9-fc63-98b2-5293e3956669@linux.alibaba.com> <5bc88eee-21d9-14c2-6544-d4e3baa931cb@linux.alibaba.com> From: Joseph Qi Message-ID: <5510650e-2e5d-2f7c-e1ef-b118389125d5@linux.alibaba.com> Date: Thu, 12 Dec 2019 13:51:45 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <5bc88eee-21d9-14c2-6544-d4e3baa931cb@linux.alibaba.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/12/12 11:55, Changwei Ge wrote: > Hi Joseph, > > On 12/11/19 9:17 PM, Joseph Qi wrote: >> >> >> On 19/12/11 18:03, Kai Li wrote: >>> If journal is dirty when mount, it will be replayed but jbd2 sb >>> log tail cannot be updated to mark a new start because >>> journal->j_flag has already been set with JBD2_ABORT first >>> in journal_init_common. When a new transaction is committed, it >>> will be recored in block 1 first(journal->j_tail is set to 1 in >>> journal_reset). >>> >>> If emergency restart happens again before journal super block is >>> updated unfortunately, the new recorded trans will not be replayed >>> in the next mount. >>> >> I think I've finally understood the problem. But I don't think it has >> been clearly described for reviewing. I strongly suggest you describe >> the problem in the way of timeline, such as in which step, do what >> operation, and what is the status, etc. >> >> >>> This exception happens when this lun is used by only one node. If it >>> is used by multi-nodes, other node will replay its journal and its >>> journal sb block will be updated after recovery. >>> >>> To fix this problem, use jbd2_journal_flush to mark journal as empty as >>> ocfs2_replay_journal has done.> >> Sounds reasonable. But IMO, it is really a corner use scenario, using >> cluster filesystem in single node... > > True, this use case should be rare. > But considering that fixing this is not complicated and does no harm at least, I am inclining taking this in. We can only merge it to mainline rather than -stable branches. :-) > Okay, let's move it on. Thanks, Joseph