From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5D62C76567 for ; Thu, 27 Feb 2020 14:36:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B34402468F for ; Thu, 27 Feb 2020 14:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582814214; bh=aw7Svsx23HcevhZY1M3o7LC/cFBXEJ6bclr2+oCFSeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=USIfe/NEDgNW9yfnmbD9IgzhpazsAd/mxP7qaBCJZlYfRLByN0C3hCR0cDrguRKYa lOiTpH8Sur5lToxtqxOjU+lZ6QxW5p/gW9hk1NsFLtTRvDZ9w0M/ZzYJyt/jbnv49A v8aeEPccIjf0hHzGiws1SaM6LzAE6XjZUaZY2FoY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733216AbgB0Ogx (ORCPT ); Thu, 27 Feb 2020 09:36:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:59528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732116AbgB0N6X (ORCPT ); Thu, 27 Feb 2020 08:58:23 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 02F022073D; Thu, 27 Feb 2020 13:58:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582811901; bh=aw7Svsx23HcevhZY1M3o7LC/cFBXEJ6bclr2+oCFSeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ElYptYl9wwvGLcSlbS4fiCg7F+nyeTTf01tuG6HXG7VAf2c+vX9LJGgslE2ueNWhd +b4UYhf9mPWvhRAR44oTH93iBuFgUv22O02SwjpYg4CukiV0M5ppIXa1DE7ds8joWd V86QZUg8Fbbh8P2yo/6TFAUApjVlgIOnUAbQ0vrE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "zhangyi (F)" , Jan Kara , Theodore Tso , Sasha Levin Subject: [PATCH 4.14 144/237] jbd2: make sure ESHUTDOWN to be recorded in the journal superblock Date: Thu, 27 Feb 2020 14:35:58 +0100 Message-Id: <20200227132307.229914458@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132255.285644406@linuxfoundation.org> References: <20200227132255.285644406@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: zhangyi (F) [ Upstream commit 0e98c084a21177ef136149c6a293b3d1eb33ff92 ] 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) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20191204124614.45424-4-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- 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 eae9ced846d51..6e054b368b5fe 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2119,8 +2119,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.20.1