Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1032032yba; Thu, 4 Apr 2019 02:52:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuVKJvMwLBt3vcJq2cuYHqPXau0swXlPd3aRJfE3SGqvsnIkWSEGUgSe4AkXTtrsRdN82U X-Received: by 2002:a65:484a:: with SMTP id i10mr4926711pgs.408.1554371554401; Thu, 04 Apr 2019 02:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554371554; cv=none; d=google.com; s=arc-20160816; b=z5h2l2oKtg514bjCWAH3hOyIep1rUR55oE7rXlHtTStyoxzhqO+eiU1rpuxK9tU5yX /oMIzXW8ksj2BIS/ZbSX58+UZbaEUac6NmoQvZCVSAhHBivpnaJoT5sLaybR1pVRyKE2 RDCXHhqwnEP/4JLuGeSfS4vp3yser9fOfHkHjRBWCuOwQ70txUXk8jXGn0vuV+XRiFKA dX6793ngnbGtAa6E5K0XFc5bTqrX3KrCGJr2wjjYjpgTcANbRN4I7RUWmPzKz1bMAOBp As1zIACjUg14MCQfOLwA5hHACHLDGDQqE4vyQdOc3ecanF1k3JiBu9nQ6ysP2qEfYNgt nz0Q== 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=55o3SyPb+33TYKYjIgS569SbaiUWTdrbpL9GzqzAbms=; b=KhAjTr1FlbuVBqCmhXvkNfz0nERo6g6xj175j+WbgBHT6nZ5c/FbF2JSSjJez32Dxd 0dJT0sA/ii67tUdNO+4WV0G8Zx0w4gkA4d5FiBuXHvmydkXPH9e7grndxjhp2m1wTTSo E0ScNtUHj+gfFzu0bijFcDuAjx95aU/B2KnP3lTIJLfkW0npDjtaJajBCLohNCh3UNZY qv6N0jnemwcRvsnzW3wsSGFZhTReWeiKTliILcIpSR94gXa+wWYFujFSbFUs6+DQDAt6 QtA9BqBeb69vaEWtXidjL6Br93f7HXYInDbNbYRZ9R6n1B1fz2ZWyLAUBWS+NZTQH589 TEWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HujMAXYg; 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 n13si5780117pgl.348.2019.04.04.02.52.19; Thu, 04 Apr 2019 02:52:34 -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=HujMAXYg; 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 S1730345AbfDDJve (ORCPT + 99 others); Thu, 4 Apr 2019 05:51:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:57548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729121AbfDDIys (ORCPT ); Thu, 4 Apr 2019 04:54:48 -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 8493F217D9; Thu, 4 Apr 2019 08:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368088; bh=h00KFOl+8el4uZizwr/hNAiMLN9BtLVsIm/xzONlchI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HujMAXYgJzlaTyeJh3OvQX5VzaD+jjvgPoj9EIrFf6BuBdjCqMO7FqpDlD1iA3+MT mW4lVv8Yy1KGL4+1GS+w+HFWxTkbfAzAv0Via5sSxQk1XIMghd7F9ec4/rvKqy0A5N XBPnHfILt5Cwzyn8vhVtgVWPxtR3nchBPftn8i8I= 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.14 033/121] jbd2: fix invalid descriptor block checksum Date: Thu, 4 Apr 2019 10:47:01 +0200 Message-Id: <20190404084547.132838127@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084545.245659903@linuxfoundation.org> References: <20190404084545.245659903@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.14-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 3c1c31321d9b..d11401afd52f 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -693,9 +693,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