Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp201966rwb; Mon, 28 Nov 2022 19:19:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf4RTx47+tAsGe9ZhrMrsgJBeqx/ZXYL8iinKxvRCsVTIrXJHGwx16ZZg0gykvEcyr31JYpn X-Received: by 2002:a63:e46:0:b0:477:9dfb:5d3f with SMTP id 6-20020a630e46000000b004779dfb5d3fmr30324620pgo.317.1669691967819; Mon, 28 Nov 2022 19:19:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669691967; cv=none; d=google.com; s=arc-20160816; b=yqt44F33CD+9djXaPUHj529YJYdgWH9vZfE1mRsT8cYCUEGxCSo/yhWLP3qhI9bghK jcZLd1U1WiJN4z74RJuEp3Z1gSRtkph7aypNIwHUEK+LdL4S1TR3IVEZJ0bDtpjYXapf 02jvzlusQ36ql34iRSR+SD7wLOClsL/obSrXTBeZiKo/PQu8aCcGOflMz7BCTV3TV0q+ KttgMbbC+n2RA/ZdcAjPoZ5b9Wq0rvuSi7wjSVTyxNDyTRnYOfit4e1OZLLBzwEMKgnB davv2+N5p1nOK0Npdy8YGzLGHpQKaEWrlfu+syM0u7rQi/SAk/xDZaLD1P6zv7EKt3lY 5KkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=M4rHxCg6JKzqJ4nEeTDWsAlMSHzC3QVS7TIvKuS9ZnU=; b=hDBfkKYuBy7DJhgUHCzNG68HyiNAONhBsUIbaIu26jwUsAIuktbwWsXKB32Sua+E5m B1tDAMG9d+bBFqMYH/pI8S5Z+7/nGC9VIEa27eWb6WGsGixg2bjdOht54RUut7GjVJk8 kFP50HMCFf54bd7i6KVmWG71/v0i6gokIM6+CxrRHytwheQf61C5Qp55kKguWzodrl+C WYLBUetNCTff7BsA4UShuvdBjqav2vZalw1Tosh8boq0KEPvt7/tdMff1BqwTwUc4V5p zG6N9TtS3THOWSgZrB2zmfFy+WIK8SvFGun1eY/sc6R4DJAt/hSS6crLNkm9M4ob+ErI 2vWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b="G74482q/"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a6566d4000000b00478446557bdsi126721pgw.18.2022.11.28.19.18.44; Mon, 28 Nov 2022 19:19:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-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; dkim=fail header.i=@mit.edu header.s=outgoing header.b="G74482q/"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234934AbiK2DG6 (ORCPT + 99 others); Mon, 28 Nov 2022 22:06:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235428AbiK2DGz (ORCPT ); Mon, 28 Nov 2022 22:06:55 -0500 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E69FE09; Mon, 28 Nov 2022 19:06:50 -0800 (PST) Received: from cwcc.thunk.org (pool-173-48-120-46.bstnma.fios.verizon.net [173.48.120.46]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 2AT36cD1024412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 22:06:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1669691201; bh=M4rHxCg6JKzqJ4nEeTDWsAlMSHzC3QVS7TIvKuS9ZnU=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=G74482q/+yr023kqbiRqx5pY6uGFJRMwASJX18GB0m1Mm4i0qTd7DfjaZD4QGioNR xbJdu2bHxfiPexSIOYaUyneufYE6/d8Dh412oFgGlE0j1Pb5YJAA3nMGdhzGPuo7Dj YOynz6eFC+fZYqKkcsGZG9VO0ViGsSKr3OP/U4H4GvTUQoQmlPClosn+mFtOtI/6mk w019MFqyXtoGokVCSLw6Jdw/QYSf6L2jU98lCOd1ELTmujuPMK6iLrb0cKSr7pH92f tFOIYTxi95b6nA/HVM++qZXRFJ8eJUFnvaQ3ERyL179Z7IyPM4qLj5TgjBUOQpEUiB Web6qozKGNbBg== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 4ED1815C00E4; Mon, 28 Nov 2022 22:06:34 -0500 (EST) Date: Mon, 28 Nov 2022 22:06:34 -0500 From: "Theodore Ts'o" To: Ojaswin Mujoo Cc: linux-ext4@vger.kernel.org, Ritesh Harjani , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Dilger , Jan Kara , rookxu , Ritesh Harjani Subject: Re: [PATCH v2 7/8] ext4: Use rbtrees to manage PAs instead of inode i_prealloc_list Message-ID: References: <8421bbe2feb4323f5658757a3232e4c02e20c697.1665776268.git.ojaswin@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8421bbe2feb4323f5658757a3232e4c02e20c697.1665776268.git.ojaswin@linux.ibm.com> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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-ext4@vger.kernel.org This commit (determined via bisecion) seems to be causing a reliable failure using the ext4/ext3 configuration when running generic/269: % kvm-xfstests -c ext4/ext3 generic/269 ... BEGIN TEST ext3 (1 test): Ext4 4k block emulating ext3 Mon Nov 28 21:39:35 EST 2022 DEVICE: /dev/vdd EXT_MKFS_OPTIONS: -O ^extents,^flex_bg,^uninit_bg,^64bit,^metadata_csum,^huge_file,^die EXT_MOUNT_OPTIONS: -o block_validity,nodelalloc FSTYP -- ext4 PLATFORM -- Linux/x86_64 kvm-xfstests 6.1.0-rc4-xfstests-00018-g1c85d4890f15 #8492 MKFS_OPTIONS -- -F -q -O ^extents,^flex_bg,^uninit_bg,^64bit,^metadata_csum,^huge_filc MOUNT_OPTIONS -- -o acl,user_xattr -o block_validity,nodelalloc /dev/vdc /vdc generic/269 23s ... [21:39:35][ 3.085973] run fstests generic/269 at 2022-11-28 215 [ 14.931680] ------------[ cut here ]------------ [ 14.931902] kernel BUG at fs/ext4/mballoc.c:4025! [ 14.932137] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 14.932366] CPU: 1 PID: 2677 Comm: fsstress Not tainted 6.1.0-rc4-xfstests-00018-g19 [ 14.932756] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-debian-4 [ 14.933169] RIP: 0010:ext4_mb_pa_adjust_overlap.constprop.0+0x18e/0x1c0 [ 14.933457] Code: 66 54 8b 48 54 89 4c 24 04 e8 ae 92 9f 00 41 8b 46 40 85 c0 75 bc4 [ 14.934270] RSP: 0018:ffffc90003aeb868 EFLAGS: 00010283 [ 14.934499] RAX: 0000000000000000 RBX: 00000000000000fc RCX: 0000000000000000 [ 14.934830] RDX: 0000000000000001 RSI: ffffc90003aeb8d4 RDI: 0000000000000001 [ 14.935146] RBP: 0000000000000200 R08: 0000000000008000 R09: 0000000000000001 [ 14.935447] R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000103 [ 14.935744] R13: 0000000000000101 R14: ffff8880073370e0 R15: ffff888007337118 [ 14.936043] FS: 00007f94eda0b740(0000) GS:ffff88807dd00000(0000) knlGS:000000000000 [ 14.936390] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 14.936634] CR2: 000055ba905a0448 CR3: 000000001092c005 CR4: 0000000000770ee0 [ 14.936932] PKRU: 55555554 [ 14.937048] Call Trace: [ 14.937190] [ 14.937285] ext4_mb_normalize_request.constprop.0+0x1e9/0x440 [ 14.937534] ext4_mb_new_blocks+0x3a2/0x560 [ 14.937715] ext4_alloc_branch+0x21e/0x350 [ 14.937892] ext4_ind_map_blocks+0x322/0x750 [ 14.938076] ext4_map_blocks+0x380/0x6e0 [ 14.938260] _ext4_get_block+0xb2/0x120 [ 14.938426] ext4_block_write_begin+0x13c/0x3d0 [ 14.938624] ? _ext4_get_block+0x120/0x120 [ 14.938801] ext4_write_begin+0x1c1/0x570 [ 14.938973] generic_perform_write+0xcf/0x220 [ 14.939175] ext4_buffered_write_iter+0x84/0x140 [ 14.939377] do_iter_readv_writev+0xf0/0x150 [ 14.939562] do_iter_write+0x80/0x150 [ 14.939722] vfs_writev+0xed/0x1f0 [ 14.939871] do_writev+0x73/0x100 [ 14.940016] do_syscall_64+0x37/0x90 [ 14.940186] entry_SYSCALL_64_after_hwframe+0x63/0xcd [ 14.940403] RIP: 0033:0x7f94edb02da3 [ 14.940559] Code: 8b 15 f1 90 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f8 [ 14.941341] RSP: 002b:00007ffc5e82d0d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 [ 14.941659] RAX: ffffffffffffffda RBX: 0000000000000036 RCX: 00007f94edb02da3 [ 14.941961] RDX: 0000000000000356 RSI: 000055ba901c1240 RDI: 0000000000000003 [ 14.942290] RBP: 0000000000000003 R08: 000055ba901cf240 R09: 00007f94edbccbe0 [ 14.942596] R10: 0000000000000080 R11: 0000000000000246 R12: 000000000000062a [ 14.942902] R13: 0000000000000356 R14: 000055ba901c1240 R15: 000000000000b529 [ 14.943219] [ 14.943326] ---[ end trace 0000000000000000 ]--- Looking at the stack trace it looks like we're hitting this BUG_ON: spin_lock(&tmp_pa->pa_lock); if (tmp_pa->pa_deleted == 0) BUG_ON(!(start >= tmp_pa_end || end <= tmp_pa_start)); spin_unlock(&tmp_pa->pa_lock); ... in the inline function ext4_mb_pa_assert_overlap(), called from ext4_mb_pa_adjust_overlap(). The generic/269 test runs fstress with an ENOSPC hitter as an antogonist process. The ext3 configuration disables delayed allocation, which means that fstress is going to be allocating blocks at write time (instead of dirty page writeback time). Could you take a look? Thanks! - Ted