Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp381780ybl; Wed, 4 Dec 2019 04:26:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxrlTsxpRzqemOCT4HKKOExKG7L0a0SOlNsguhKAKj4pZRK4XBYjPoUCw5u4AUUIZdkkxuH X-Received: by 2002:a05:6830:91:: with SMTP id a17mr2073341oto.107.1575462417777; Wed, 04 Dec 2019 04:26:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575462417; cv=none; d=google.com; s=arc-20160816; b=NbCO9MddZl4o98gYobgMuuwU2Omome05t4bHP5kLhVNWq3S21pU/NBwSQLLoHihGz/ D1pmwRbVi5VzCZGHkbJU3eHFlxXGIwwZ3ex5f80RDcV3hCD53LgRGPz8Cc20nOscsrpA 86qrVDa0fgSYR6LcVsKFQh744QcOu6yIJxFSTNZV7TSgHH85AYSSpI7fT8hpVhuai4PO AYTsM5xwGbEaDWBMr3zMtYIDmNv7UNO1Hx74eNR7D4C1AGdR1oblMCp3Sk5eoBG/30hw u0SZ4/CGW7f4tdFvvZV5sqydSjqVkygmtWq2ITXCz975bbK8QQzLeN3+8yb27wwvftqj k3dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=woIV7LfJGrLTW6NdMfG5iTN4nzBU/DUMMGOYylZM/as=; b=qshemm/a7X66lvW4trxleiUMG7sQ5/J2S8nYFtEfSzkbfahIBYcHWnU+GxnSeAF4BW 0uQayilN7FSO8JcxIG8jzgwUD73wGsf7IB+KepA4dUTkqMTZIBglB7qerpPV7XdIjs63 xsRsTEcpm+csYAabivxS+Zv1nP5mn0Uj99cX3QEkfugq7rHpVdmm/7F7zRbN6l8t2Epv k6i1Vs0KxcpABvJJEc1m+EaLxGwtXsGo9sS87EExJqh6+UcOiT+N4EpKDh2k9RXA34Z9 B3ZnYFkdAJ/QG5CEUxqX8uL5zIb2tNqpGWhmCompDX+TFZDBDnfXPQP5p8XwvK9xs6U7 BPgA== 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 b10si2808003otp.124.2019.12.04.04.26.46; Wed, 04 Dec 2019 04:26:57 -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 S1727682AbfLDMZ2 (ORCPT + 99 others); Wed, 4 Dec 2019 07:25:28 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:6748 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727798AbfLDMZ1 (ORCPT ); Wed, 4 Dec 2019 07:25:27 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 3416EC20B49CA12C697D; Wed, 4 Dec 2019 20:25:26 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Dec 2019 20:25:18 +0800 From: "zhangyi (F)" To: CC: , , , , , Subject: [PATCH v3 3/4] jbd2: make sure ESHUTDOWN to be recorded in the journal superblock Date: Wed, 4 Dec 2019 20:46:13 +0800 Message-ID: <20191204124614.45424-4-yi.zhang@huawei.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20191204124614.45424-1-yi.zhang@huawei.com> References: <20191204124614.45424-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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) --- 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