Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp676879ybl; Wed, 4 Dec 2019 09:06:37 -0800 (PST) X-Google-Smtp-Source: APXvYqybpriy86YUeuQ06achz8bTIoeUEoD8/f60qm4TKsuMHbHjyukVYoYcJ/EaD+u1GyaY1B+t X-Received: by 2002:a9d:464:: with SMTP id 91mr3427513otc.255.1575479197753; Wed, 04 Dec 2019 09:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575479197; cv=none; d=google.com; s=arc-20160816; b=0YckxO+V00gfMwIDQ7Cm/v7KMXzCK8Qd3+BNHvAprRx6cF7k5cfxOZypUPC3CUimK+ U9mb6memwSRVnRNwdIc61IXXnVy9bCLj/kD/EmctNDy2Ix0f2avU5XVLsrxQKdLE7GV6 Xd+tcdKpYlsDCnuSFZaOPt4WbWs9091cOSRRWnLz8zGazW7P1ItZZdo4nuAkxJZQOEqy SgcYcKULzubRFcnaOw5Bb4r3z6FXFAsm0hejDESr6XovETJElkCe2VaotPfdlbZCc6+N FBNNTMKSoHZifucK7DlB1vJfJSw4RXC36fP2BhAySw8rZ0FhP13TAmZ1uIK/piM3OIn3 nrfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Rq1syOtvRX+eTFMum/9Va3MdXirJuwCDW1oILIIp3Is=; b=TDs28U3TTre74kMs1c0w3FYlQC1VKt5Ba5zqZmpUGlthFrdn4mdtbdAMjIec3Dzhyh wDypFWOvrqNmpKbnVoSysQjISSp9XxXCGdys3UkzvWPpaUvwcP9F7vwm83pnDURhDXwN N9Z0lyzR+bIw24J4KFhJrMOXyp2rbpScV1QZ6hC24OarbYbWUSKLMgL4jpZ1CrKgrj2e rxQfJQxtEwBmAf+6a2cRT8fNBWyHMYKS786m5JOQD6WQp4/pn049JNK3YWGXGlgoPTW6 ZJ7t3563AIm5f/oM1UMti0pzTJIO5RJHcvBT65BCPyt4L60djsdzYJgfKg22Q3oEsSnG Pxqg== 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 w16si3564332oih.154.2019.12.04.09.06.06; Wed, 04 Dec 2019 09:06:37 -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 S1728972AbfLDRFc (ORCPT + 99 others); Wed, 4 Dec 2019 12:05:32 -0500 Received: from mx2.suse.de ([195.135.220.15]:37564 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728784AbfLDRFc (ORCPT ); Wed, 4 Dec 2019 12:05:32 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BEB85B1F7; Wed, 4 Dec 2019 17:05:30 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 012471E0B99; Wed, 4 Dec 2019 18:05:28 +0100 (CET) Date: Wed, 4 Dec 2019 18:05:28 +0100 From: Jan Kara To: "zhangyi (F)" Cc: linux-ext4@vger.kernel.org, jack@suse.com, tytso@mit.edu, adilger.kernel@dilger.ca, liangyun2@huawei.com, luoshijie1@huawei.com Subject: Re: [PATCH v3 3/4] jbd2: make sure ESHUTDOWN to be recorded in the journal superblock Message-ID: <20191204170528.GH8206@quack2.suse.cz> References: <20191204124614.45424-1-yi.zhang@huawei.com> <20191204124614.45424-4-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191204124614.45424-4-yi.zhang@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 Honza > --- > 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 > -- Jan Kara SUSE Labs, CR