Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp997232yba; Thu, 4 Apr 2019 02:03:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzWgepQgmYmeM86BK0l6OCVcYuewv8zr3vmrEBHX64+WrQCmQba0AuaL+zOKbB5PEWUyZx X-Received: by 2002:a63:bd42:: with SMTP id d2mr4649142pgp.319.1554368620635; Thu, 04 Apr 2019 02:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368620; cv=none; d=google.com; s=arc-20160816; b=naIOtznoB5DA8SrCoSVsW5U+pUFUIx6H7K+t8N0F0Ib2WDnCJsPnW53sqlmzCOXyrp DjNFBwPj+61/rwGUncmGxD/L/dq1Utwe4gwstHnx0BER6j9Z/xMAfSDzxvx/zCasoZqE jfaQYNUtg54liDdf0sSmNaHtAmBsN18BLVrLshxaT8IPmU/SiRyXNnMfiUFmjB/hrW48 kGvNin5QydKQXVNSsYef09cnrKi9ZkrMJ9vYssH7XsEF8rw2D9bO04mPbrguuIo52v0X sPPrqFUdOGRs1zqnU1FVvg+g8lVNELmobbP7+6jnZixd+oPwEjui/xK+a9uPhtMdm5kv 52dA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DLgAMa9Ft9eQ+5opzbK8AsGvhi0f0zPxku3CWtWKdwA=; b=IQzgHjRIMSwzT5LB81z3RvaSuG8eQ4BPXpEitZmxLBJUr8DLQdOtDJ5xY6LntFMW8m VzbcuFjCDUR6Vlpyuo0hXoIkVkjP+w3qkZ/YmHQWWdF1kL0LfKu/deAdlgxJbqZycCWn 0Ox3wP8LiiRfJrbHSS/Xwi9wohuQuYgGoar/6otukGic0EbVPAXJlFmaT3AIWXsOJIlk BplGWbxutLSWklA46MtCAcQ/std5C741ng8ZuWrkk1E1zPznIZGPQNO+h9r8F0pyOnOK l/XEMn+RkHhFmN4qtg0iyqh2jVcrcQofAXqDphKqqkH9smRhl1Mn7h4VtpW45WyxeJnY olBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T+zBJpzp; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8si14991010pgp.68.2019.04.04.02.03.25; Thu, 04 Apr 2019 02:03:40 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=T+zBJpzp; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731449AbfDDJBh (ORCPT + 99 others); Thu, 4 Apr 2019 05:01:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:38726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729984AbfDDJBe (ORCPT ); Thu, 4 Apr 2019 05:01:34 -0400 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 1E2392147C; Thu, 4 Apr 2019 09:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368493; bh=2AUYNOR6M6y5fgXj7UzFkNiN/LlzH9BWPxMNBOWiswU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T+zBJpzpqhivjuThlH0ToiMQcqOQrEeZ+xFTTbPgLHjE3MH38D7qI/r4SmMen2yIy QSaC7yBskjVwS6iLdnMRZq4QvdnTCm/AGVNhqc3JAKupdYgRaub7YaAGiM2mZ9CqoV ALJPoD28S8eyWFZjRiG0bUs1P6+3spxFJDr2NwBw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, luojiajun , Theodore Tso , Jan Kara , Sasha Levin Subject: [PATCH 4.19 044/187] jbd2: fix invalid descriptor block checksum Date: Thu, 4 Apr 2019 10:46:21 +0200 Message-Id: <20190404084605.156532712@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 6e876c3dd205d30b0db6850e97a03d75457df007 ] In jbd2_journal_commit_transaction(), if we are in abort mode, we may flush the buffer without setting descriptor block checksum by goto start_journal_io. Then fs is mounted, jbd2_descriptor_block_csum_verify() failed. [ 271.379811] EXT4-fs (vdd): shut down requested (2) [ 271.381827] Aborting journal on device vdd-8. [ 271.597136] JBD2: Invalid checksum recovering block 22199 in log [ 271.598023] JBD2: recovery failed [ 271.598484] EXT4-fs (vdd): error loading journal Fix this problem by keep setting descriptor block checksum if the descriptor buffer is not NULL. This checksum problem can be reproduced by xfstests generic/388. Signed-off-by: luojiajun Signed-off-by: Theodore Ts'o Reviewed-by: Jan Kara Signed-off-by: Sasha Levin --- fs/jbd2/commit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 150cc030b4d7..65ea0355a4f6 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -691,9 +691,11 @@ void jbd2_journal_commit_transaction(journal_t *journal) the last tag we set up. */ tag->t_flags |= cpu_to_be16(JBD2_FLAG_LAST_TAG); - - jbd2_descriptor_block_csum_set(journal, descriptor); start_journal_io: + if (descriptor) + jbd2_descriptor_block_csum_set(journal, + descriptor); + for (i = 0; i < bufs; i++) { struct buffer_head *bh = wbuf[i]; /* -- 2.19.1