Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2743670rwl; Mon, 26 Dec 2022 21:52:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXv9jsmCf9dDf8UfuWlB8l6aXtvls/08yoeftHNTd2RSN+msCJUo9A/As3SBMp4fVwOd7/pf X-Received: by 2002:a17:902:d355:b0:189:7e2f:d64c with SMTP id l21-20020a170902d35500b001897e2fd64cmr43064006plk.55.1672120357417; Mon, 26 Dec 2022 21:52:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672120357; cv=none; d=google.com; s=arc-20160816; b=nCfPL7hxEs73MZq9TG3LfTd5zkCB6LRhTp3yiDK1KtrzROzgoDfmPojaoQBYJJv/Wx fdr/kn4PJzsPfvp3W4XOsp4YY4Q1oI8Hiciycs/GkCyV/yj5ms3Z7iYz0RfSv+E1Vf6k mVzAhJtPGz5hNH5mUV9enFQqY4Cphs4wfILWx4zyV/mnbQXVkSRl1lnR/sHkN9wQ9zU2 VQNxQ2b/fxmAme5LOI0P9sDm8uLzyy9tR/DpcLaJxag2NXbPWuFfp1zTq6YDWPP5EI2A bM7iYQJhBzfZhLfOcV8rgQFBj6pE2hud3EpXk/8vZ4T28kwe4A+4272TBrODK1pisYfu 1Tyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:in-reply-to:subject:from :references:cc:to:content-language:user-agent:mime-version:date :message-id; bh=ngzX7ITQBgqgwza9neHrw8hWafcbBFQKUAUB35gn3ho=; b=DoFb3TulBS4P/YojN6rRNaFYJz85Oogr2dGnNFFOfJeJRrPnbjvf0bpggXnQoOkJsF gjPWu8lcSI6Irl9WLGhl/9lbFsa4XqO87AMeVVh8BOFsU831qEQgcWs9SKJijJsNAnhq uAqyJNmssLEGRUIbVUQHv8kcggS0iJ5aB4aN/Hrbjl5vZmZHVPHcW3l20y/VHQgaGDQP 2hKJdPiTJZLVgU5tNkQPkwyJgecFzMFSgpu9WX+wFTQn8J/aqIBxMSUd6t3VSfhvhPyV N8lTJ9cxtaKoCw+hYmLtI1bP8ng7yq0Xr6VhkOFwWL+q4IsRO+TfF18QnLdZc3XTPne6 jy7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a17090332c200b0018989a041dfsi14515599plr.124.2022.12.26.21.52.20; Mon, 26 Dec 2022 21:52:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229573AbiL0FOH (ORCPT + 67 others); Tue, 27 Dec 2022 00:14:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbiL0FOD (ORCPT ); Tue, 27 Dec 2022 00:14:03 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6E0725F6; Mon, 26 Dec 2022 21:14:01 -0800 (PST) Received: from [0.0.0.0] ([149.28.201.231]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MYNNo-1pMYxq2Xb8-00VPPW; Tue, 27 Dec 2022 06:13:57 +0100 Content-Type: multipart/mixed; boundary="------------ENQBTkI975Siu72IN5GNSZpk" Message-ID: Date: Tue, 27 Dec 2022 13:13:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Content-Language: en-US To: Mikhail Gavrilov Cc: wqu@suse.com, dsterba@suse.com, Btrfs BTRFS , Linux List Kernel Mailing References: <18b5fa1e-7d1e-4560-c98b-d7ac5fc87c3a@gmx.com> <0036622d-53f7-eaba-f720-6dd9bdca28ad@gmx.com> <41734bdb-2df0-6596-01b6-76a7dfd05d64@gmx.com> <24cd64b2-4536-372c-91af-b425d2f6efd4@gmx.com> From: Qu Wenruo Subject: Re: [6.2][regression] after commit 947a629988f191807d2d22ba63ae18259bb645c5 btrfs volume periodical forced switch to readonly after a lot of disk writes In-Reply-To: X-Provags-ID: V03:K1:qdf9hFidGub2Z+Xt3aVh+ueGVwk5Snvl/nbRjHJHdLgaxnT1EVT oQXPrS8tE0FjJ4alWPLPEsuWjqhwje1XXc4A1Y4HVRUh3uhk/BgeqgoGJ7NjRWJOKcdICoK jwR2DkfOrL6ETN7LwMQLj8loRcFTRNMgkTJwTQoEugaqfq4X9h3L2Q0/ZDJDxolRfV7Tb0o hv63P61dlyVlhJe+ziRKA== UI-OutboundReport: notjunk:1;M01:P0:bAv+bFMv33g=;4G/L+s5MmbNuLFii5TbQaNLihit L67Y1yS55GsmZCR7wJOqbeGbECcI0gkgZ/xeppzO6d85J7mw1WVruQA8K0MuNWV7Ma3oTg0iz pcKhuIPwJmzXS0YnyEPJ6dB1feIOx+7l+zNInT4211rftjnC8O2YrB7mzcheSRz84G/PhtOFY wJK1PQ5tk5+AZPxGhfm6eMg0ugVnU4GmfeJuI9nyXP53Sn3+vLxUsEt+4LHBQYXb89AZ1RcWb ly0B4J8C99Gqbwd42zBaVTH9pC63rRlmD8SjQi+tIP5COI8haBWz/xFhRsgl5O3st4yvEOORk mI/ZxaWLm7BKT7Jkx0wKIovNHcqr1pTSbasunwMKYbvlvFTCWuCHFY4bQyPp4/+IDjxVFfgP4 fj9LQ3zV5Y5fCyX7bjtcpWHm24vM2dOIoVOOB9qPvFd0imsaa2qVM9Kq/CbV+jtKWkULBYddZ bEHs3xw9z7kjJWyCxZ6JmdQLG2ciYSjBXcxYLHnXaDL95WbyvRy5oWje5yEYcnkOM/21QOcFo 8TZsbuX9l3iod3YJcYuTRzuuRuXNRW+d4FSKpy45irvkhpru+rNDaXWgdiyJLo/9i1eYYZsUp oU+bMAlrnAPzsmb56JcSMXRIznKNPKC0wkRzEEtOwnbaMOKjHpHdUoJHU5PYQ2ub2fgXEBZUe 0+f0w6RBF+YUL0kR+Yup9bw3kYwp5QA2+v6QCYjZzW8xbyyjyad/nH+SuMRcVhS1GS/B8Yvxm 5f8GzyQKiL96jpXxdVicL016AAHZaqTXSItyz762uEEZsgKf8G14hjuofRNzjLIgkmdQnhvAo nJ5YUnX20CH8ml+W2e2GwWUi9cS2OT8a+SURxR1nNAIMWzp3Hel8opZLNaKgol6xS9fvgW1N5 XQMuodTQjR4jpSvAbBLDf6NUih9OYJKhfVsiltRUTWNam0AjbjSsLwKpMjw9ilkJOLBXalt2X dAdd9+H7z+w8I16ajxuCkSZD51w= X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------ENQBTkI975Siu72IN5GNSZpk Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2022/12/27 09:35, Mikhail Gavrilov wrote: > On Tue, Dec 27, 2022 at 5:18 AM Qu Wenruo wrote: >> >> My bad, missing a ")" in the WARN_ON() line. >> >> Fixed with v3 patch. >> > > New kernel logs are ready. > The result doesn't make sense... A lot of read_block_for_search() and btrfs_read_node_slot() are triggering the warning. But inside both functions, we have just set the numbers before the call: In read_block_for_search() we got: check.has_first_key = true; check.level = parent_level - 1; check.transid = gen; check.owner_root = root->root_key.objectid; Thus at least check.has_first_key is always true, and the WARN_ON() should never get triggered. The same applies to btrfs_read_node_slot(). It looks like something involved in memory barrier. Anyway, the latest debug patch has extra mb to be sure. And despite the possible fix, could you provide extra info of your build? Include: - Hardware (mostly CPU and RAM spec) - Toolchain used to compile the kernel (include compiler and its version) - Kernel config Thanks, Qu --------------ENQBTkI975Siu72IN5GNSZpk Content-Type: text/x-patch; charset=UTF-8; name="0001-btrfs-add-extra-debug-for-level-mismatch.patch" Content-Disposition: attachment; filename="0001-btrfs-add-extra-debug-for-level-mismatch.patch" Content-Transfer-Encoding: base64 RnJvbSA5ZDgxYmZlNDgyOTE5NjRlYWY2NThjMDhhNzFmMDRjMzgzOTU5MmQwIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpNZXNzYWdlLUlkOiA8OWQ4MWJmZTQ4MjkxOTY0ZWFmNjU4YzA4 YTcxZjA0YzM4Mzk1OTJkMC4xNjcyMTE3OTcwLmdpdC53cXVAc3VzZS5jb20+CkZyb206IFF1 IFdlbnJ1byA8d3F1QHN1c2UuY29tPgpEYXRlOiBNb24sIDI2IERlYyAyMDIyIDE2OjQ0OjA4 ICswODAwClN1YmplY3Q6IFtQQVRDSCB2NF0gYnRyZnM6IGFkZCBleHRyYSBkZWJ1ZyBmb3Ig bGV2ZWwgbWlzbWF0Y2gKCkN1cnJlbnRseSBJIGFzc3VtZSB0aGVyZSBpcyBzb21lIHJhY2Ug b3IgdW5pbml0aWFsaXplZCB2YWx1ZSBmb3IKY2hlY2s6OmxldmVsLgoKVGhlIGV4dHJhIG91 dHB1dCBhcmUgZm9yIHR3byBsb2NhdGlvbnM6CgotIHZhbGlkYXRlX2V4dGVudF9idWZmZXIo KQog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