Message ID | 20240302181755.9192-1-shikemeng@huaweicloud.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-89392-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp390581dyc; Sat, 2 Mar 2024 01:22:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWhb7ocOKUiTvE2FiNB9jvZSM/9lostawMGGWH3s30F3I5ZO60jEjf116G2Mgx8GXhLdGcZf8OUPf8EK/gAYl89VUTjZA== X-Google-Smtp-Source: AGHT+IGSEgdARmxYMEI9nsUNF5rNlYXGXzbl/kpGdtXnF2XzdpZJwd8X5k2MXXITfJkubu1+4xMK X-Received: by 2002:a05:6a00:2da1:b0:6e5:5daf:f397 with SMTP id fb33-20020a056a002da100b006e55daff397mr4639759pfb.13.1709371368439; Sat, 02 Mar 2024 01:22:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709371368; cv=pass; d=google.com; s=arc-20160816; b=bJyXjliDj3nmCL+3l+UEC9c5EUhqWdgPB7KAhp87lCq5bDmw3hhdHVCGv6txIay6oI ToOwaSBxAtJabOkyCCgLWULP0eVuh/oTnmz0SSCSpCmMHGLgFyVFoMVbnOczyb+g2qDF 395m244Ovb4Sq4cU4VHZMGKUhPj97V7+KlxaB2LfxlECSx72NOg3OZggLi1r74LQetnM JptdFlkdKyqCbhvlpa5TGs5/3Gh+VkJGbFARAXHxijmr+SmH924cLgF02O3TWMDkL77z 5fSqw43dtAn2DO7rHp3i+NlR5edv85m0MizzYX7twlGrgfl1VgpsewPv5S2o1Q9pZhtd sd2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=IcbcU0sbMgoKDSVaqp6/VIqYnCjxlEpZV+7PJ9LXqVQ=; fh=F5xKjzVfoX4U1ctxq5p9Tuw3OchS51SLNsBn6NIWrhw=; b=cUmvd+bGBBxWnzP3sFiU7GC55VBvqunKFl/o6JBc5ptILb6coN8oXScwQ/QpAGpJRl a/0N09c5Ee6j1YfTK1gsdwuCNPQ3o67ys8hlMYAbNP1kFfv9LDNb7m2z7S9MNNELWvCe zHWCdrhDy5SEYQKp0vZMDBgtG35888UXNbM/9oC3IQ8GVYSnxT1krQ5CS88AEVM7Hrjj XqQHM2Vr61ZAujyju7HU9+v0leMdkrcdo7oXzt4sRgctcCrpIjOj7DreVA0C7sWGMFJA XNC3heunyMNT9SRKxndTb3Y5KrqJ9GOX173jB00HC147vD+MMfUoY/mPPqStEIrH8tlR ehJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-89392-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89392-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x34-20020a056a000be200b006e3f7e38f78si4957254pfu.59.2024.03.02.01.22.48 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 01:22:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89392-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-89392-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89392-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4B3DA282A92 for <ouuuleilei@gmail.com>; Sat, 2 Mar 2024 09:22:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 624EB17994; Sat, 2 Mar 2024 09:21:25 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1197134A1; Sat, 2 Mar 2024 09:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709371283; cv=none; b=EWMCeCdkUWyLPZYZRZyE82GH5QsvFwD8Douq9+9FD46Grwxy5R8TIMIg6HVxXAOBytoD6JoD2HHxgkmmicAygIvh6SBJKzPd/qODUVSrVHXK51e62VsT/5NqYG6yu+dL/eIODkB6qU4TqNvqdzN6o327CRC+79TNXyb0xwGZmhU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709371283; c=relaxed/simple; bh=qdezucad5cPvzaEjmiAU3jX0Q8SyunCIEy72jkWfi5E=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PTeAxagwl1gSW02SMjEgTvh7BPeL7/noelLj+Dar1bT1OOEmBqwsCqMqJnAIo2JiUITutE4AM2JBv5kntPsT6HOXB8OegsDdemlsxozO3xcpdcPRZ2R85h/R5gEZu4ENTB89G/bJC6vLI312DyDUxNnFdpy5H94fLN2tOyuRvkY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TmzwJ4J3sz4f3lg8; Sat, 2 Mar 2024 17:21:04 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 072411A0C43; Sat, 2 Mar 2024 17:21:12 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.101.6]) by APP4 (Coremail) with SMTP id gCh0CgA3imyE7+Jld1cqFw--.52350S2; Sat, 02 Mar 2024 17:21:10 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, naresh.kamboju@linaro.org, daniel.diaz@linaro.org, linux@roeck-us.net, brauner@kernel.org Subject: [PATCH v3 0/3] Fix crashes and warning in ext4 unit test Date: Sun, 3 Mar 2024 02:17:52 +0800 Message-Id: <20240302181755.9192-1-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgA3imyE7+Jld1cqFw--.52350S2 X-Coremail-Antispam: 1UD129KBjvdXoW7XF1DZF47ZFWfXry5Kr4fGrg_yoWfGrb_GF W8Z3s5JrWxJ3WjyFWxtryFqry8Kay2yry8ZF47JFW3GrWxZw17Aa4kGr1vy3Z8Ww45Ar9I q3Wvkr1fZwnFqjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb7kYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l87I20VAvwVAaII0Ic2I_JFv_Gryl8c AvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWD JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oV Cq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG 8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2js IE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY 0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I 0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAI cVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcV CF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280 aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxUIf-PUUUUU X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792405791539546916 X-GMAIL-MSGID: 1792405791539546916 |
Series |
Fix crashes and warning in ext4 unit test
|
|
Message
Kemeng Shi
March 2, 2024, 6:17 p.m. UTC
v2->v3: -fix warning that sb->s_umount is still held when unit test finishs -fix warning that sbi->s_freeclusters_counter is used before initialization. v1->v2: -properly handle error from sget() Previously, the new mballoc unit tests are only tested by running "./tools/testing/kunit/kunit.py run ..." in which case only rare configs are enabled. This series fixes issues when more debug configs are enabled. Fixes are tested with and without kunit_tool [1]. [1] https://docs.kernel.org/dev-tools/kunit/run_manual.html Kemeng Shi (3): ext4: alloc test super block from sget ext4: hold group lock in ext4 kunit test ext4: initialize sbi->s_freeclusters_counter before use in kunit test fs/ext4/mballoc-test.c | 77 ++++++++++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 17 deletions(-)
Comments
On 3/2/24 10:17, Kemeng Shi wrote: > v2->v3: > -fix warning that sb->s_umount is still held when unit test finishs > -fix warning that sbi->s_freeclusters_counter is used before > initialization. > > v1->v2: > -properly handle error from sget() > > Previously, the new mballoc unit tests are only tested by running > "./tools/testing/kunit/kunit.py run ..." in which case only rare configs > are enabled. > This series fixes issues when more debug configs are enabled. Fixes are > tested with and without kunit_tool [1]. > > [1] https://docs.kernel.org/dev-tools/kunit/run_manual.html > > Kemeng Shi (3): > ext4: alloc test super block from sget > ext4: hold group lock in ext4 kunit test > ext4: initialize sbi->s_freeclusters_counter before use in kunit test > > fs/ext4/mballoc-test.c | 77 ++++++++++++++++++++++++++++++++---------- > 1 file changed, 60 insertions(+), 17 deletions(-) > I still see crashes with this version. Some examples below. Guenter --- mips: KTAP version 1 # Subtest: test_mark_diskspace_used CPU 0 Unable to handle kernel paging request at virtual address 00780000, epc == 807a4b28, ra == 807a4c20 Oops[#1]: CPU: 0 PID: 112 Comm: kunit_try_catch Tainted: G N 6.8.0-rc6-next-20240301-11397-g2cd922b7255b #1 Hardware name: mti,malta $ 0 : 00000000 00000001 00780000 00000000 $ 4 : 811c6de0 00000000 00000001 00000000 $ 8 : 00000005 00000000 82f0cc00 00000001 $12 : ffffffff 00000002 00000000 fff80000 $16 : 82d99558 811c6de0 00000000 00000020 $20 : 811c0000 00000000 00000001 00000000 $24 : 00000000 80415884 $28 : 82f1c000 82f1f9f8 00000000 807a4c20 Hi : 00000000 Lo : 00002128 epc : 807a4b28 percpu_counter_add_batch+0x7c/0x224 ra : 807a4c20 percpu_counter_add_batch+0x174/0x224 Status: 1000a402 KERNEL EXL Cause : 00800008 (ExcCode 02) BadVA : 00780000 PrId : 00019300 (MIPS 24Kc) Modules linked in: Process kunit_try_catch (pid: 112, threadinfo=82f1c000, task=82c2cec0, tls=00000000) Stack : 82d99400 b332f3f3 00000000 b332f3f3 82f1fb20 811c0000 00000000 00000000 811c0000 82d99400 82d63800 00000008 00000000 80414ac4 00000000 801a4aa4 00000001 00000000 00000020 00000001 00000000 82f1fa70 00000000 00000023 00000080 82f1fb20 82f1fb20 00000380 82c2cec0 00000000 00000000 b332f3f3 82f1fae0 00000025 82d63800 821bbc08 00000001 00000001 821f12a8 82f0cc00 ... Call Trace: [<807a4b28>] percpu_counter_add_batch+0x7c/0x224 [<80414ac4>] ext4_mb_mark_diskspace_used+0x25c/0x26c [<80414ba4>] test_mark_diskspace_used+0xd0/0x308 [<806e8fe0>] kunit_try_run_case+0x70/0x204 [<806eb1dc>] kunit_generic_run_threadfn_adapter+0x1c/0x28 [<80162be0>] kthread+0x128/0x150 [<80103038>] ret_from_kernel_thread+0x14/0x1c Code: 02242021 8c820000 00431021 <8c5e0000> 001e17c3 03d5a021 00523021 029e902b 02469021 ---[ end trace 0000000000000000 ]--- Various arm emulations: [ 6.617298] # Subtest: test_mark_diskspace_used [ 6.620243] ok 1 block_bits=10 cluster_bits=3 blocks_per_group=8192 group_count=4 desc_size=64 [ 6.622190] 8<--- cut here --- [ 6.622374] Unable to handle kernel paging request at virtual address 0a3f6000 when read [ 6.622549] [0a3f6000] *pgd=00000000 [ 6.622960] Internal error: Oops: 5 [#1] SMP ARM [ 6.623138] Modules linked in: [ 6.623342] CPU: 0 PID: 187 Comm: kunit_try_catch Tainted: G N 6.8.0-rc6-next-20240301-11397-g2cd922b7255b #1 [ 6.623573] Hardware name: Freescale i.MX6 Ultralite (Device Tree) [ 6.623738] PC is at percpu_counter_add_batch+0x2c/0x110 [ 6.624171] LR is at percpu_counter_add_batch+0xa8/0x110
on 3/3/2024 11:33 PM, Guenter Roeck wrote: > On 3/2/24 10:17, Kemeng Shi wrote: >> v2->v3: >> -fix warning that sb->s_umount is still held when unit test finishs >> -fix warning that sbi->s_freeclusters_counter is used before >> initialization. >> >> v1->v2: >> -properly handle error from sget() >> >> Previously, the new mballoc unit tests are only tested by running >> "./tools/testing/kunit/kunit.py run ..." in which case only rare configs >> are enabled. >> This series fixes issues when more debug configs are enabled. Fixes are >> tested with and without kunit_tool [1]. >> >> [1] https://docs.kernel.org/dev-tools/kunit/run_manual.html >> >> Kemeng Shi (3): >> ext4: alloc test super block from sget >> ext4: hold group lock in ext4 kunit test >> ext4: initialize sbi->s_freeclusters_counter before use in kunit test >> >> fs/ext4/mballoc-test.c | 77 ++++++++++++++++++++++++++++++++---------- >> 1 file changed, 60 insertions(+), 17 deletions(-) >> > > I still see crashes with this version. Some examples below. > Thanks so much for the test and report. It's likely cuased by using sbi->s_dirtyclusters_counter uninitialized. Will fix it in next version. Kemeng > Guenter > > --- > mips: > > KTAP version 1 > # Subtest: test_mark_diskspace_used > CPU 0 Unable to handle kernel paging request at virtual address 00780000, epc == 807a4b28, ra == 807a4c20 > Oops[#1]: > CPU: 0 PID: 112 Comm: kunit_try_catch Tainted: G N 6.8.0-rc6-next-20240301-11397-g2cd922b7255b #1 > Hardware name: mti,malta > $ 0 : 00000000 00000001 00780000 00000000 > $ 4 : 811c6de0 00000000 00000001 00000000 > $ 8 : 00000005 00000000 82f0cc00 00000001 > $12 : ffffffff 00000002 00000000 fff80000 > $16 : 82d99558 811c6de0 00000000 00000020 > $20 : 811c0000 00000000 00000001 00000000 > $24 : 00000000 80415884 > $28 : 82f1c000 82f1f9f8 00000000 807a4c20 > Hi : 00000000 > Lo : 00002128 > epc : 807a4b28 percpu_counter_add_batch+0x7c/0x224 > ra : 807a4c20 percpu_counter_add_batch+0x174/0x224 > Status: 1000a402 KERNEL EXL > Cause : 00800008 (ExcCode 02) > BadVA : 00780000 > PrId : 00019300 (MIPS 24Kc) > Modules linked in: > Process kunit_try_catch (pid: 112, threadinfo=82f1c000, task=82c2cec0, tls=00000000) > Stack : 82d99400 b332f3f3 00000000 b332f3f3 82f1fb20 811c0000 00000000 00000000 > 811c0000 82d99400 82d63800 00000008 00000000 80414ac4 00000000 801a4aa4 > 00000001 00000000 00000020 00000001 00000000 82f1fa70 00000000 00000023 > 00000080 82f1fb20 82f1fb20 00000380 82c2cec0 00000000 00000000 b332f3f3 > 82f1fae0 00000025 82d63800 821bbc08 00000001 00000001 821f12a8 82f0cc00 > ... > Call Trace: > [<807a4b28>] percpu_counter_add_batch+0x7c/0x224 > [<80414ac4>] ext4_mb_mark_diskspace_used+0x25c/0x26c > [<80414ba4>] test_mark_diskspace_used+0xd0/0x308 > [<806e8fe0>] kunit_try_run_case+0x70/0x204 > [<806eb1dc>] kunit_generic_run_threadfn_adapter+0x1c/0x28 > [<80162be0>] kthread+0x128/0x150 > [<80103038>] ret_from_kernel_thread+0x14/0x1c > Code: 02242021 8c820000 00431021 <8c5e0000> 001e17c3 03d5a021 00523021 029e902b 02469021 > ---[ end trace 0000000000000000 ]--- > > Various arm emulations: > [ 6.617298] # Subtest: test_mark_diskspace_used > [ 6.620243] ok 1 block_bits=10 cluster_bits=3 blocks_per_group=8192 group_count=4 desc_size=64 > [ 6.622190] 8<--- cut here --- > [ 6.622374] Unable to handle kernel paging request at virtual address 0a3f6000 when read > [ 6.622549] [0a3f6000] *pgd=00000000 > [ 6.622960] Internal error: Oops: 5 [#1] SMP ARM > [ 6.623138] Modules linked in: > [ 6.623342] CPU: 0 PID: 187 Comm: kunit_try_catch Tainted: G N 6.8.0-rc6-next-20240301-11397-g2cd922b7255b #1 > [ 6.623573] Hardware name: Freescale i.MX6 Ultralite (Device Tree) > [ 6.623738] PC is at percpu_counter_add_batch+0x2c/0x110 > [ 6.624171] LR is at percpu_counter_add_batch+0xa8/0x110 > >