Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp212103ybv; Wed, 12 Feb 2020 22:39:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxQiKfCSgAjj6g/3oluVVHmIFrZkzpa/ZkdkTgmH3XmSdVJhO7mBx17nHl567Y1x9HI7nWl X-Received: by 2002:a9d:7f98:: with SMTP id t24mr12735654otp.338.1581575999765; Wed, 12 Feb 2020 22:39:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581575999; cv=none; d=google.com; s=arc-20160816; b=NtjSH84YwubofwBNzG/df+r6dD9wc4XvRVTozUtWDRzfF1mx5w3vY0cZrsW8fOwbxL 0q692ejShTfI16DC4HXvEehWz5rLGI8gl/12xdx1IklHfcNUifykLHb81TTkxJ7ZEMQN Sgthb4xqtk9D39EtzxuUXTmF83TZWEF5h2UjeVnDy+Qdm599sDzG57kKkpYEv/ne/a1q UsHzMMWZHzZs3rwX+BnxBOJL+moi58Gfr7R3fG8fGKqf69AT6RSbPT8+dub5+wOm2dzF 5wQjvV+IE3e4llsyAJQcFiR4cCi8KybzduBTbQ/rbOX7j1/5rlYabQqw8hkOiZv4JgDN d5gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=ZgdAIhkLv2E7EBJ2LCjNVCDEdKtZYdYqXpGVuMdbLa4=; b=UBkdTLw4Tsfa7w8ARrcTtndJ/5ggyW0+oBtzki6Lp0bAQt7r/xWYvS0t3qAHOpROUQ nfr3HV1QrW+5ycTJoMBykvDC1mdvAL9uIKPrRvOCAWT8JpMPYedHwK/mBU1Zl9gmzZX1 ZoHg5J2dcpwJ7MZ+AAhuoM4vW8UqZMb1LN5EVBKsDFQvc/miwMuSAxk/Hl4BFDBCrIhP gYgSX/PhEIcqt9KcCpGPJbdbr75K1uU1HQVglqgsrYXb5hF/6qq92qDfprOd0NsaSUhk K59w2UHfAul9qgVlkunDk+aJNidhkx9Y1uYd9LHVmjRzT2INyP8AHd6nTt7otXlrObJQ VENg== 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 t185si783602oib.39.2020.02.12.22.39.40; Wed, 12 Feb 2020 22:39:59 -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 S1729364AbgBMGjh (ORCPT + 99 others); Thu, 13 Feb 2020 01:39:37 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9730 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727123AbgBMGjh (ORCPT ); Thu, 13 Feb 2020 01:39:37 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 5542655A8DC8A2B8B619; Thu, 13 Feb 2020 14:39:34 +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; Thu, 13 Feb 2020 14:39:25 +0800 From: "zhangyi (F)" To: , CC: , , , Subject: [PATCH v3 0/2] jbd2: fix an oops problem Date: Thu, 13 Feb 2020 14:38:19 +0800 Message-ID: <20200213063821.30455-1-yi.zhang@huawei.com> X-Mailer: git-send-email 2.17.2 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 Changes since v2: - Back to use "mapping && !sb_is_blkdev_sb(mapping->host->i_sb)" to distinguish metadata buffers, and add more comments. - Add 'Reviewed-by' to the first patch. Changes since v1: - Switch to clear b_modified just after set_buffer_freed() instead of reuse codes at the end of journal_unmap_buffer(). - Switch to distinguish metadata buffers through the page mapping dev. Thanks, Yi. -------------- Original description: We encountered a jbd2 oops problem on an aarch64 machine with 4K block size and 64K page size when doing stress tests. Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 ... user pgtable: 64k pages, 42-bit VAs, pgdp = (____ptrval____) ... pc : jbd2_journal_put_journal_head+0x7c/0x284 lr : jbd2_journal_put_journal_head+0x3c/0x284 ... Call trace: jbd2_journal_put_journal_head+0x7c/0x284 __jbd2_journal_refile_buffer+0x164/0x188 jbd2_journal_commit_transaction+0x12a0/0x1a50 kjournald2+0xd0/0x260 kthread+0x134/0x138 ret_from_fork+0x10/0x1c Code: 51000400 b9000ac0 35000760 f9402274 (b9400a80) ---[ end trace 8fa99273d06aeb63 ]--- These patch set can fix this issue, the first patch is just a cleanup patch, and the second one describe the root cause and fix it. zhangyi (F) (2): jbd2: move the clearing of b_modified flag to the journal_unmap_buffer() jbd2: do not clear the BH_Mapped flag when forgetting a metadata buffer fs/jbd2/commit.c | 46 +++++++++++++++++++++++-------------------- fs/jbd2/transaction.c | 10 ++++++---- 2 files changed, 31 insertions(+), 25 deletions(-) -- 2.17.2