Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp501208yba; Wed, 15 May 2019 05:14:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQdvm3uCxN7thb6rStaQ9DmVNrZsSKF7j/IkYlh+FjNekW8dWUuBsTbnKBc+HvT4W0u0v4 X-Received: by 2002:a17:902:b108:: with SMTP id q8mr38326590plr.110.1557922492044; Wed, 15 May 2019 05:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557922492; cv=none; d=google.com; s=arc-20160816; b=O1fBA0teq+/wSJBXPpLN1DAuKVUAyNhcbDcfgQaa4yoniC0AVro+hoh1J445qTGL44 ixsCZc/9WKx8YqlQ25BKRIpC85XQWc8654F0TGFQl1WA5MnjnAIWQemMpam9h3uJfOT4 guk8zm6zNhqWfqm++LSw5mwhnuTDvjg/OL3Q56G+kaJYKul6dJUeFLdu1x2Tv9p2O4aq QRmE0I3ARYEmRbSVUH7iqF3GBFK0ifL+OozwIeYQgrdjiNr8Q9VCgLXT2BVnRIwGtQmw ZCWxdllCx/tLn+c2i0TbURlx2Kx/h+7o+OQC31m5e4xJZ442U6Ervy1phkluC77/PKfA UBwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date; bh=VpxxlQsGL0+3c08mSAEtziyKgTywUn5sr2WVSODAN9w=; b=J9AwEUVgTuk6YU4nCkh0vcHUf+WOvEb0pnZeHltqvbSaO17bVfwYMbOeCTk1gfjrvN viU3aWQ+0/+e2Lq8E9cPgOe4bZOyP3Vbtg0aAX1X5nWBMWzM8yZqOxHKd+AY55C53Hgb S6kYQyocm98xgPja58ZTmxq8Ft8bmnucNZFllLaYqTskTQ4/kvZCp7TDRnsZltNQns/x dtWT+ooH+atHRxSHIfy65gbFh1UK6gpsicvmMK4FfJu0jltre2lCqPPodXsmWp4BkZRL FqIac5dxHv7swDHzg6BgkhRbWN1mkPQmiL1k+SdQRqOECU35ulFjAgB7MtM2A99kSTTq RBgQ== 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 r84si2064980pfa.10.2019.05.15.05.14.32; Wed, 15 May 2019 05:14:52 -0700 (PDT) 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 S1729135AbfEOMM0 (ORCPT + 99 others); Wed, 15 May 2019 08:12:26 -0400 Received: from ipmail01.adl6.internode.on.net ([150.101.137.136]:1443 "EHLO ipmail01.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728426AbfEOMMW (ORCPT ); Wed, 15 May 2019 08:12:22 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2ACAACO3/JbAFaJfQENVQ4LAQEBAQEBA?= =?us-ascii?q?QEBAQEBBwEBAQEBAYFTAgEBAQEBCwGEEoN4gl6THiWXNoF6CAGEcAKEDzYHDQE?= =?us-ascii?q?DAQECAQECEAE0hgwBAQEBAyMEUhALDQQDAQIBKgICAk0IBg4FgyEBgRynPHB8M?= =?us-ascii?q?xqFJoRND4JtEYdHgxc/gREnDBOCTIReAQEeFwmCZDGCBCICiRKGQAQvT48bBwK?= =?us-ascii?q?CGgSCAYF0iyyBWIUIgxEDD4Z6mWMBggUzGi5vAYJBkCBKYgGMHYI+AQE?= Received: from unknown (HELO [10.135.5.170]) ([1.125.137.86]) by ipmail01.adl6.internode.on.net with ESMTP; 15 May 2019 21:42:17 +0930 Date: Wed, 15 May 2019 21:42:11 +0930 User-Agent: K-9 Mail for Android In-Reply-To: <20190515045717.GB5394@mit.edu> References: <48BA4A6E-5E2A-478E-A96E-A31FA959964C@internode.on.net> <20190511220659.GB8507@mit.edu> <09D87554-6795-4AEA-B8D0-FEBCB45673A9@internode.on.net> <850EDDE2-5B82-4354-AF1C-A2D0B8571093@internode.on.net> <17C30FA3-1AB3-4DAD-9B86-9FA9088F11C9@internode.on.net> <20190515045717.GB5394@mit.edu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----WSCHIZVN6A37NMST66JKY3S8MFUOKF" Content-Transfer-Encoding: 7bit Subject: Re: ext3/ext4 filesystem corruption under post 5.1.0 kernels To: Theodore Ts'o CC: Richard Weinberger , LKML , linux-ext4@vger.kernel.org From: Arthur Marsh Message-ID: Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org ------WSCHIZVN6A37NMST66JKY3S8MFUOKF Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 15 May 2019 2:27:17 pm ACST, Theodore Ts'o wrote: >Ah, I think I see the problem=2E Sorry, this one was my fault=2E Does >this fix things for you? > > - Ted > >From 0c72924ef346d54e8627440e6d71257aa5b56105 Mon Sep 17 00:00:00 2001 >From: Theodore Ts'o >Date: Wed, 15 May 2019 00:51:19 -0400 >Subject: [PATCH] ext4: fix block validity checks for journal inodes >using indirect blocks > >Commit 345c0dbf3a30 ("ext4: protect journal inode's blocks using >block_validity") failed to add an exception for the journal inode in >ext4_check_blockref(), which is the function used by ext4_get_branch() >for indirect blocks=2E This caused attempts to read from the ext3-style >journals to fail with: > >[ 848=2E968550] EXT4-fs error (device sdb7): ext4_get_branch:171: inode >#8: block 30343695: comm jbd2/sdb7-8: invalid block > >Fix this by adding the missing exception check=2E > >Fixes: 345c0dbf3a30 ("ext4: protect journal inode's blocks using >block_validity") >Reported-by: Arthur Marsh >Signed-off-by: Theodore Ts'o >--- > fs/ext4/block_validity=2Ec | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/fs/ext4/block_validity=2Ec b/fs/ext4/block_validity=2Ec >index 8d03550aaae3=2E=2E8e83741b02e0 100644 >--- a/fs/ext4/block_validity=2Ec >+++ b/fs/ext4/block_validity=2Ec >@@ -277,6 +277,11 @@ int ext4_check_blockref(const char *function, >unsigned int line, > __le32 *bref =3D p; > unsigned int blk; >=20 >+ if (ext4_has_feature_journal(inode->i_sb) && >+ (inode->i_ino =3D=3D >+ le32_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_journal_inum))) >+ return 0; >+ > while (bref < p+max) { > blk =3D le32_to_cpu(*bref++); > if (blk && I have built kernels with the attached patch applied and run git gc on the= patched kernels (both the 32 bit kernel on the Pentium-D and the 64 bit ke= rnel on the Athlon II X4 640)=2E=20 There were a couple of warnings from other processes being blocked while t= he git gc was taking place but no filesystem corruption detected=2E (I ran = forced fsck checks on the root filesystems after the git gc runs to check f= or corruption)=2E=20 Thanks for the patch!=20 Arthur=2E=20 --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E ------WSCHIZVN6A37NMST66JKY3S8MFUOKF Content-Type: application/octet-stream; name="ext4.tmp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="ext4.tmp"; size=506 ZGlmZiAtLWdpdCBhL2ZzL2V4dDQvYmxvY2tfdmFsaWRpdHkuYyBiL2ZzL2V4dDQvYmxvY2tfdmFs aWRpdHkuYwppbmRleCA5NjhmMTYzYjVmZWIuLjY2MTQ2YTcxMTg3MSAxMDA2NDQKLS0tIGEvZnMv ZXh0NC9ibG9ja192YWxpZGl0eS5jCisrKyBiL2ZzL2V4dDQvYmxvY2tfdmFsaWRpdHkuYwpAQCAt Mjc2LDYgKzI3NiwxMSBAQCBpbnQgZXh0NF9jaGVja19ibG9ja3JlZihjb25zdCBjaGFyICpmdW5j dGlvbiwgdW5zaWduZWQgaW50IGxpbmUsCiAJX19sZTMyICpicmVmID0gcDsKIAl1bnNpZ25lZCBp bnQgYmxrOwogCisJaWYgKGV4dDRfaGFzX2ZlYXR1cmVfam91cm5hbChpbm9kZS0+aV9zYikgJiYK KwkoaW5vZGUtPmlfaW5vID09CisJCWxlMzJfdG9fY3B1KEVYVDRfU0IoaW5vZGUtPmlfc2IpLT5z X2VzLT5zX2pvdXJuYWxfaW51bSkpKQorCXJldHVybiAwOworCiAJd2hpbGUgKGJyZWYgPCBwK21h eCkgewogCQlibGsgPSBsZTMyX3RvX2NwdSgqYnJlZisrKTsKIAkJaWYgKGJsayAmJgo= ------WSCHIZVN6A37NMST66JKY3S8MFUOKF Content-Type: application/octet-stream; name="20190515iucode_tool.log" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="20190515iucode_tool.log"; size=4281 WyAxMDg4LjE1NTAyNV0gSU5GTzogdGFzayBpdWNvZGVfdG9vbDo5NDU2IGJsb2NrZWQgZm9yIG1v cmUgdGhhbiAxMjAgc2Vjb25kcy4KWyAxMDg4LjE1NTAzMl0gICAgICAgTm90IHRhaW50ZWQgNS4x LjArICMzNDE3ClsgMTA4OC4xNTUwMzNdICJlY2hvIDAgPiAvcHJvYy9zeXMva2VybmVsL2h1bmdf dGFza190aW1lb3V0X3NlY3MiIGRpc2FibGVzIHRoaXMgbWVzc2FnZS4KWyAxMDg4LjE1NTAzNV0g aXVjb2RlX3Rvb2wgICAgIEQgICAgMCAgOTQ1NiAgIDk0NTMgMHgwMDAwNDAwMApbIDEwODguMTU1 MDM5XSBDYWxsIFRyYWNlOgpbIDEwODguMTU1MDUyXSAgPyBfX3NjaGVkdWxlKzB4Mjk3LzB4Njkw ClsgMTA4OC4xNTUwNTVdICA/IF9yYXdfc3Bpbl9sb2NrX2lycXNhdmUrMHgyMi8weDUwClsgMTA4 OC4xNTUwNTddICBzY2hlZHVsZSsweDMzLzB4YzAKWyAxMDg4LjE1NTA3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