From patchwork Mon Oct 7 15:28:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13824915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A7B6CFB449 for ; Mon, 7 Oct 2024 15:28:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E20746B009F; Mon, 7 Oct 2024 11:28:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D81796B00A2; Mon, 7 Oct 2024 11:28:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B658C6B00A3; Mon, 7 Oct 2024 11:28:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8A2646B009F for ; Mon, 7 Oct 2024 11:28:54 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 10270ABEA6 for ; Mon, 7 Oct 2024 15:28:54 +0000 (UTC) X-FDA: 82647188988.16.050BE4E Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 99354140005 for ; Mon, 7 Oct 2024 15:28:50 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="hx/ZbCaa"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vRX0wUyY; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf09.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1728314821; a=rsa-sha256; cv=pass; b=jdbzrl/xf9febY4M/wqYtXLZv4hi34o6mhtNOsTX5RMNTjN/3HmkQCrcJZA6Nci+GEQ6n1 03Xjxro8cG9rKrBhNMyat1PFqL/IDX2ejZs68l7ww7rvK6WHsGVj61tq+VmX0PZSJKJP+i CN0XPGZRjcYCZrKPkykMuvXukmy1nec= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="hx/ZbCaa"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=vRX0wUyY; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf09.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728314821; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7A482o+x7brxhc1TRdgH9QdPrxF7DFUUes+N+8w9TI4=; b=uZMAXK3hFNl+cGUk8cOWOciqyZaq8ZsLND9YwzOpNPiOe1QVfhFLaRextXSUDz8mS6ZjNi wLOgsSwNmLcv0be5LQDavPIgYDdKq6oB8uGIC5uwG5y8ag/Dy4W71vJ93L2P0WHZ34/SW1 DMg8hT6kst0UVWBRUEOmF6220CPmTRQ= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 497FMemE022952; Mon, 7 Oct 2024 15:28:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=7A482o+x7brxhc1TRdgH9QdPrxF7DFUUes+N+8w9TI4=; b= hx/ZbCaa1Zp4H2lYsfIEhF3NOQsQJ0nrk0uC/dsMyQpdEfiu1Yz7ew42j0ul13gP D/oXAhubkEOCnf+45Pqszr6Gcc7dFF7Se/aBIGSXMFOUA7yVhhi1sDkktPNYOIGh ZKcD70qlpshylddspbxay9kZvYawnQYpoaWCvHKA25GnBt4KmTR4mVB92eJEpE/C 2WCxOuBGtWjLKx3mt3HQeOo95Bya5Jl8FeNz7S3iVb4IwBLNVSiPlI/4z1782dk5 v43Rrmuf7qdWWD4xF/1ae2lp164RI5tfsFGY/rumuboK2OkBQDKCB2cQX74dpR9u 3DcB5btA8SZ8suhSK47mWg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42303ybpff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Oct 2024 15:28:46 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 497FOjc1011736; Mon, 7 Oct 2024 15:28:45 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 422uw5xa26-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Oct 2024 15:28:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l8JiTZNFb9ROckTGwFSk7DN8yNUPE8t6ubUuGAZFXOqb+CPuP0WWSw2+SoNYVC7GaSzhHqjrD/0Zdyfv5sg1XknQgrMu02pckYaVtflM8NUeoCGxbbcsd7cvddpvnTXxpLBmTpX4fFuLY7dv82WSa6QhvJhX0nB4Pvt0mtdHLfXuT5/Dy2e2Um29By+xrTzwirZaNGr3o/V+D+mv6Mi5cNMUHood9Z9+2HtPkNr22Wm1+mDZbj+zrEG9kOBAn4Ijvm+iOrusbrElvR+XV+1UeG6mQU85uDxcgf2l1Jd8P8b0nmpMpSoVby1qSXhV51TxhqYOxm1Wmv8ZbM4/HRzaiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7A482o+x7brxhc1TRdgH9QdPrxF7DFUUes+N+8w9TI4=; b=ifzN5sgQgk01DfaXyFmNwAJMSjcBnRuPYqMMPiqMS32uVxJUJQepLT3tNX2nhCIuMQDS6P9et9ALT/1WkMA5O+LaqmN4f6rVomr1QMXcH1QUxPFRX2dRz26swaarR3zCzVFoUNCb8kuJKJuVzd8U7AFhNubnjR8VP3E4Wjafz6BL/0EeKlx/PXSS5t+ZGYTgUXEjNJVjPe8V4UGIFlKmmF9Hhk0eycbVbYhcmgMkrGwkLEupRbR/LSRdRzOPePuMPV+2LnNux7gHAJWmGCxhtwWHIYdS+ATnC7eBRG8BSePWLLlF+xAaxpVH8NmNyW31ohJdCv3p4Lgb4Skbas/Mtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7A482o+x7brxhc1TRdgH9QdPrxF7DFUUes+N+8w9TI4=; b=vRX0wUyY1Ko9TA7QkAtUclEPSS+Zki3lLkCbz0oGOjy7PZpeAPManC/tVTd6Sy/ZYC6TIU7U7PsPE6slM15fwWpzsd7o5Iole5/AeP85TwrqcrpQJecW6FFSeBDAagVWwDk3oyah+QetlGW4OdWz3pFK6hkJtPWyub7ygpYTF+M= Received: from SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) by SA1PR10MB6640.namprd10.prod.outlook.com (2603:10b6:806:2b6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.20; Mon, 7 Oct 2024 15:28:43 +0000 Received: from SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e]) by SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e%5]) with mapi id 15.20.8026.020; Mon, 7 Oct 2024 15:28:43 +0000 From: Lorenzo Stoakes To: Andrew Morton , "Liam R . Howlett" Cc: Matthew Wilcox , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sidhartha Kumar , Bert Karwatzki , Mikhail Gavrilov , maple-tree@lists.infradead.org Subject: [PATCH hotfix 6.12 v3 2/2] maple_tree: add regression test for spanning store bug Date: Mon, 7 Oct 2024 16:28:33 +0100 Message-ID: <30cdc101a700d16e03ba2f9aa5d83f2efa894168.1728314403.git.lorenzo.stoakes@oracle.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: References: X-ClientProxiedBy: LO2P265CA0482.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13a::7) To SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5613:EE_|SA1PR10MB6640:EE_ X-MS-Office365-Filtering-Correlation-Id: 475c713b-fff5-404b-67e9-08dce6e4ba3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: 7xGocnQM3F2sa9WqpLfMpYamxogfyRLl2kHZ3a4r+fmrs0xb2JztTaygUTpN9FqzKFHMLzoYboyGmMU9/PNB3yNLdF8FDEqtYKTttFKQfIWi8508cmCDzzv7ZcCDdA/gW71msj2BJjF/Dr7kO5+0Ota+KIgkhfYwrgUgI/6bxho80WRYvdQ26zOCNYeWTGUGXje2OjQ+aIB1LMURN3v0kjuMqMSUg3W9PBIUfM0tRNpnjfb6AeFXaO76HKyACmBYQOJ6tT9TZGDPfhdYYEteAjXquntlwk/zQqQPP/4jEiUqCWkAvdkfmdmgEpOdBs0vZOhmQiHqKO0Ur1BrNUSsxHS/4Ll3z1M6imCon5yjDCSZCa9rO+YPi4ENwUJCHLcereGONOCPtbVnquW+EBvC1h4tJH7z3ycuvMgQr2vUUR0J5HUIrbg+UD/uXFUzfZgknxCval47hXkHt8ORVnDjfxoNqhOakbCgkGv+5xllMPv00XYvO3Rs4Gc2xRXFiObPSYIAP47YvP7HEuDEKdQWBkmV4geFtRmstl9TiVkacRUXdJungyLmYKdC0tKJQY+J34FSRG0GA6jvjBp9WgQESlCXaIYsavldunyNyPjhaRmTVZfUsPaLqO8gZ4+58yBsFJcYch8jyU7Oj8ICFeDGP+yZCVu0RHzXOxrGlqueBndHmCZK1sK0X6zYXugpsYzjwCU3QoDtvku24BVWS4uiiATqFM0YUGqVInrzlb3iMRbX9Psq5uQdwbIYox2bnn1qS8vmiPPNGXaODmX8oeq+9JipkuDQ0CEgYEo/2sfnIihl1A79C0k2CvwQh1waScgoSQdMXFBtJtHJLLb6ndrUDJVTlA1DJRlVgDohFXkCk+Msg9Z7goIFhQTTtDq229VF+9+fkTiFaUsivBO4BWZfNdl5siEndAkofG84oPap1UPBL4YUmGosTqDvDfvyh2nFmPAD9yHQ1p+lBIwwdBaITXihTzXLa6zzPy4ZssxwiDVd8VLC7oDuxBUIT6369pBHtKPegM9NmMFp/wdbxSvDzrDflx7lhewuTmbO66lrUL0fnL13mwspOPkl4+7tpNfIL8bJN+FjjRc+Nm2Wnw3v8eQWln973y3gv0X0GOM2tpH0A2EnQ2R9uWqsU03LbA5fckxq8TQaev6w7Ttc7+oKyW8j3EX87dlZnVvCfTL0r4ctz/Erb1e0q7e0ChRy62I1fKM10HKW4yj7mNeODIN88CibozUfoCdVZtEV6xEjTCKe4oJylC+vRBpjchUFNsWEKAmkue9VRerey+38o1UUfw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5613.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oTsBsZRMtYko7IBg/t/o6DOnGCBIdxgZrWvWT4twnFaVGdVvBwDQAmMP4Z3K2a1qGoyWrHt3CpXyhYfwCUUQIairZkho2XoacXnDgdsQBmn1+3vgpCg543Y6U34SfojXZyLdAhpCIr3fkKXVSXr+AqCuZKCMwhvqkviwJ7tBGhAo9rCtfG7i21EIVos2PyP4+5bok8RcdR0O9LcWfi2OmWf5FsM6WmN9a6oFTFIF710fUBmbCkmrpMGuEBMWoOaLwsHWR7mEQcTirjigCJ8VbnwMCEtx3QIPvh7rZ1PWXy6v+y/VCdSfon3p+V4QC46UWSoYjy8Af7CpmMomOrLYe/K0h7p41b3TSljQ7V8lt7PzxL0wvUPkijCc/m7WMc2noytfYojYCl9z7vewvmMJ5ta4/j1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Jt7wvkOOUCqTSiILAkGERQCvuMRvIItgtrzn0N+d7K91YXHJ9Lw/hXJoYv0d9GANT3Txl4gQ13pqSUidpzPlQEaeC5Luh9HmQu87Pw6d7rncU4pDeHCPEZpPT6SAYhV99vzg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 6ypyaQ8mWFMKVATdJTs7pNbBfl5o+nHowv/OmumRmIv5RtyMxDtbMr17s0FGYiUJuob22/jLiYijrfQj1FmGEDHF5STmhksb9wlLpD+KSED98kK9kUTcVBztXHmcY2lxfi+5qyWFXUc6HqkSFGAFwPsTscVt32d1QJrhXapQLDhd5U4nEgIU5/bGCTSmDrFSLQiMn0ONE6jIC1VwnXQfFWPcMJknPj1mlu/MbS1l85te2ZGXQ3nyuErKZHH9lf6FySQ7qb4eOMi5nVoWIKBAbn1f2gnvnB9NdH1W4WmFn7NcPeBcBBa7DaTvvgBCuaGOTR2v1Jk2pWTV2lpq3xhcVe6hbCzfhoIBCZ38Ai4qCF7YRLl9Q4uc+60l8JDtcMDHgUVtjiJSf2iNgwn8gF5os5WbzulK/m594aAy3egTtZihSrlFy3/su6CfLgonp+f0p/oHqeAIp6aKAzSsqJIQVnOKaqpMwVr91uTR77wWx7sX5Uv1/WHaic2XTqNUqv8YLhS/JnIiuYNmPB4JqGN4rGGAfy+GSb/42+Ej/gtVuxWCImRxNJOCrD1eh6ogGDjxex/aJU22Jl6e8R6yDZdaN6GxHD4xmOu/ZcNWidj/1OA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 475c713b-fff5-404b-67e9-08dce6e4ba3a X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5613.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2024 15:28:43.1901 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 28cMlZgLeZMDgvhUwahKAEu85C9YQ9ZYH2+CGhDLETvtHyf9Tnr+5Yw5mx4uGoNNTlSPZyCUMeZgsZo11fwNLChnXAtcmo043RWPkuo42U0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6640 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-07_08,2024-10-07_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410070109 X-Proofpoint-ORIG-GUID: oeXUXm8UExhEsL5CosgpITKbYz_zeLTu X-Proofpoint-GUID: oeXUXm8UExhEsL5CosgpITKbYz_zeLTu X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 99354140005 X-Stat-Signature: nht4mxnjp747b9sjaqodt1ppmmy7d87u X-Rspam-User: X-HE-Tag: 1728314930-895812 X-HE-Meta: U2FsdGVkX18OHcoPo/2nBNTj5yU89gBdSPhopP/++Bstr4gw4vuuEgCnXmx8STerAlDwto4URL9mw64lq936UwmKmW5anYrlgdQxsrxyoZxCZrRTq7w4uHE8TuWxydG292PxT/lJ+vdg6DSTIeblY5CRyE5SyI8Z26kqVWLyAdus98p+Dz6tncGzCFSQbHGO0VxeLGB1QFgsUsQJbaiOsxkOiI778aoTqp/DVqhmzr6xC4Y4qtqRVIS00zAMK9LeEHwF0J78gBVsv6Q3KEKbr/1Hulv0HWkObZ71PWZlgsbhC6P5Xn9FI/TJa7qNuNGGBvST6gZK9jLfRz5UH63AENx5O/qZxUZQwMP8ABSX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HmYW5C1zsc4kdwpz7LG+5wOTf5R1K7q+T0GYIyGpkyFkO+db2y5gOoTvZkPWkyy60oCIlzd3ua5ZpooBzSBKc8/TTtATqdJKP1zGnnEFSk84JuUU0Dhe9rLp55s4rITXO7t+PTj9d2F2ZZJcLPfiTEY7GHT1IL6O7rAOGLuxaC3fL9jEhX5IWpIbO9KdvHf7M1KvT3bJhzwdW X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Add a regression test to assert that, when performing a spanning store which consumes the entirety of the rightmost right leaf node does not result in maple tree corruption when doing so. This achieves this by building a test tree of 3 levels and establishing a store which ultimately results in a spanned store of this nature. Signed-off-by: Lorenzo Stoakes Acked-by: Vlastimil Babka Reviewed-by: Liam R. Howlett Reviewed-by: Wei Yang --- tools/testing/radix-tree/maple.c | 84 ++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) -- 2.46.2 diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 1873ddbe16cc..5fde09999be4 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -36406,9 +36406,93 @@ void farmer_tests(void) check_nomem(&tree); } +static unsigned long get_last_index(struct ma_state *mas) +{ + struct maple_node *node = mas_mn(mas); + enum maple_type mt = mte_node_type(mas->node); + unsigned long *pivots = ma_pivots(node, mt); + unsigned long last_index = mas_data_end(mas); + + BUG_ON(last_index == 0); + + return pivots[last_index - 1] + 1; +} + +/* + * Assert that we handle spanning stores that consume the entirety of the right + * leaf node correctly. + */ +static void test_spanning_store_regression(void) +{ + unsigned long from = 0, to = 0; + DEFINE_MTREE(tree); + MA_STATE(mas, &tree, 0, 0); + + /* + * Build a 3-level tree. We require a parent node below the root node + * and 2 leaf nodes under it, so we can span the entirety of the right + * hand node. + */ + build_full_tree(&tree, 0, 3); + + /* Descend into position at depth 2. */ + mas_reset(&mas); + mas_start(&mas); + mas_descend(&mas); + mas_descend(&mas); + + /* + * We need to establish a tree like the below. + * + * Then we can try a store in [from, to] which results in a spanned + * store across nodes B and C, with the maple state at the time of the + * write being such that only the subtree at A and below is considered. + * + * Height + * 0 Root Node + * / \ + * pivot = to / \ pivot = ULONG_MAX + * / \ + * 1 A [-----] ... + * / \ + * pivot = from / \ pivot = to + * / \ + * 2 (LEAVES) B [-----] [-----] C + * ^--- Last pivot to. + */ + while (true) { + unsigned long tmp = get_last_index(&mas); + + if (mas_next_sibling(&mas)) { + from = tmp; + to = mas.max; + } else { + break; + } + } + + BUG_ON(from == 0 && to == 0); + + /* Perform the store. */ + mas_set_range(&mas, from, to); + mas_store_gfp(&mas, xa_mk_value(0xdead), GFP_KERNEL); + + /* If the regression occurs, the validation will fail. */ + mt_validate(&tree); + + /* Cleanup. */ + __mt_destroy(&tree); +} + +static void regression_tests(void) +{ + test_spanning_store_regression(); +} + void maple_tree_tests(void) { #if !defined(BENCH) + regression_tests(); farmer_tests(); #endif maple_tree_seed();