From patchwork Tue Apr 25 14:09:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13223380 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 3E5A2C77B61 for ; Tue, 25 Apr 2023 14:11:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D6256B0085; Tue, 25 Apr 2023 10:11:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 986CA6B0087; Tue, 25 Apr 2023 10:11:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B1FB6B0088; Tue, 25 Apr 2023 10:11:02 -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 6DA4E6B0085 for ; Tue, 25 Apr 2023 10:11:02 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 27191C01FF for ; Tue, 25 Apr 2023 14:11:02 +0000 (UTC) X-FDA: 80720099964.15.F7ED4D4 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf19.hostedemail.com (Postfix) with ESMTP id D2D021A0006 for ; Tue, 25 Apr 2023 14:10:58 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=hcvXAqoS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FRoxXJSu; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1682431858; 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=Aq7cOJYOEZDek1MKEt0M3X1mC65LkWTwAvUR2CCJKTo=; b=xWABWJJLTp0eBuurxs7Moj/fVbNm0M6Vxqym66ZxqlNEdH9TgfUAeFegwm5aiigWtA/vsm e+VmP7TvbQU0WRE96/ZUcvZ7Xa5R2CLg0R/o/yjPbmC3FIHTkbkWzGhmG3rzMZEC89K8wt kNdsdXnbDUS5ej9KYyQYSDalA9MK8i4= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=hcvXAqoS; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FRoxXJSu; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682431858; a=rsa-sha256; cv=pass; b=8PSIo6pUt08JjsAxoaK30nLNfVDrSgVS9RR9OAEpMGTvX+C3chjnnthdEUmiyAO8Tm+Bz2 vggCxeXhwPBfMK0/8rmOBcnBu3DBgDqv9mCNHRM+a5sG/xnQaM7obZ9h2d6StBsYNPH+rK 47OOWYPk/F+TZr6HbY1/inseJwlraac= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33PDi9iF010199; Tue, 25 Apr 2023 14:10:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=Aq7cOJYOEZDek1MKEt0M3X1mC65LkWTwAvUR2CCJKTo=; b=hcvXAqoSvHYwUqSMFTp8UWgNCvrTFL/0rZFjWx+3n4zG6LAHAA88bVWRW93RmfwcCdHi AzDZz0ev0KeR/HimqCFNlpc4NLQ1JX+lBxh2IfxFPwzLaDzyqWbWM40caf/qTfh31q3W KgXvbHGMCRn+5VqZ8+2eQOq/O5vcQAFo+JnG2QxahqHJiXscce+EAY2nFx71aw7zZAt+ 9MlCo0MUGTj1wAp5gx17KzLgQCJDlmYmMzegg/S2GqjXw6E+FAgTTYJEXBwqWKMKPI5m hiOH0jnjfUVU7QhKmDciR0TFL4tWWTc5HZB9dZYIFSXQE/nZtnuqlOurK+RymPUHxNUk hg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q476twdg6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:57 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33PD619K007429; Tue, 25 Apr 2023 14:10:57 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2108.outbound.protection.outlook.com [104.47.55.108]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q4616gdj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Apr 2023 14:10:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4yeBkz3Svhmnf+WmXBTeRv3tymTT2BwcVF7AZT95ox+XUHoX/7vtuWCaA5MQ8HWGPFwcfSkkKDbxIkWAHm5Hu2+rPPx9i5VE7BQmuonO6T1rb4k//FIQUF1cShZGw8bh0LKoaMu/dcNbgbhhAsMNJe0y5yLHKIs7cjNV2yzZd5o7+EZy4DzWR4D1CtcOc8QaWr96LQo20gVUhfe+qDbeRuZNbTc8m9JhyvRMlEQk/fzimRfKJZoN36J1SCIxT49vF/9vRXYwlJR3U1Rb5xQjpGoopfi4PbtI/2fbD2GTMdo3x4UMikrHRpg99DhTdbjJicDO0NgJTj8qDvAEJgQKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Aq7cOJYOEZDek1MKEt0M3X1mC65LkWTwAvUR2CCJKTo=; b=CRGr5+ClLbKiB9oBFRjhdPL+KgifGvuySz+jKIW0bghzuBFZ//Uxy/G5maqKIsJighriraqjVKhJkMRjZxah6PWvgokYIzcuvo8R033D1vjm7It9ercyK/M8+sPplAirYtw2ZrWWdLdmRqE0vpi95wVPAJXyUPpF1pjATLMTM1JCRVjCsOjfihdbt9C5QFGB7J240Bj2S/VWn9zpBL2wnUeyHdDGgAseCJYmZz5Qkr4Tmw1RZ6Wk/HMefLVbJkczOyHwdoeFHneCc9P2Eowhsfaf2hhW43THIqHS7RksKo4SUV6v/hvHZ4idPGsh3OL1/qHj1vt6UJu7aO4VkQK8gg== 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=Aq7cOJYOEZDek1MKEt0M3X1mC65LkWTwAvUR2CCJKTo=; b=FRoxXJSumon6F7I+Nw8dG/GWmcXnfnf7ozcpUZ+mkSXwM7PM38D9S26U4mDaLuy7qF4THdAphRJb3vLWYMpi/gFTIJH5nlCCHqKk7d8p0t4xiQiJS+DYMtg7ls/cyGpoO9K94ot/yxGH68XMaEcmaPlQsCGxWX1I/1b+XJBM/ec= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by CYYPR10MB7650.namprd10.prod.outlook.com (2603:10b6:930:b8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34; Tue, 25 Apr 2023 14:10:55 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::8bb9:2bb7:3930:b5da%7]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:10:55 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, "Liam R. Howlett" Subject: [PATCH 15/34] maple_tree: Return error on mte_pivots() out of range Date: Tue, 25 Apr 2023 10:09:36 -0400 Message-Id: <20230425140955.3834476-16-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230425140955.3834476-1-Liam.Howlett@oracle.com> References: <20230425140955.3834476-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4P288CA0008.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d4::13) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|CYYPR10MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: a4385abd-aec8-41c7-db65-08db4596e268 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u/0TrPY4S4ia/9SpO525lh6BWPIFxOzHblePuj24VMKP47JAV7kv5C7EtlBR68jsTpX/nG+JUaOde3NZLrOkkoiMGbnHPnNjk7seARZnXIlcpvBui0MigPpdVmJatdX7EpbS57rbWtF9G7TlUGr8ld6nweOKaDUI3QfIjdofF+erkpOREmlc7UfiKZYNSH+J88VC+vgqi4v9Vnkocdb1kLq1avdIXeI7FnJXJ5DTZA5Wl0Owy3EdI6+C1bIV5sfwMck0UpDzY7TcUA0jqbi27evcgdn7+5QRozY7wQplkJQLWaJGYYKzxPY98B80ZtIvRl75h7G90vpqesqHFvoktUCeqBKiJ/ozWdnBFpRfcsrCynrzgrQPONXpAw5F5XRlIsFT01yaKAViaz6Q1dAxeGcUdVr2D3UVb18jk5JjmahaznbtujnCLtyy3sNuVvTr6Sl6QxLBoh1uiWnvQnWGA4fzVGgi0cOoIx4+uLTjC50lc6Vjb8tRXoRIv2F0Flc0wRki0vhNEFLQ5Lub3FL9g1dZKLBDPP7e1ACBvMvzMN4NETXgW03EMFJKLwWz3EYp X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(366004)(376002)(396003)(39860400002)(346002)(451199021)(316002)(6916009)(4326008)(38100700002)(41300700001)(5660300002)(8936002)(8676002)(36756003)(86362001)(2906002)(66476007)(66556008)(6486002)(6666004)(6512007)(6506007)(1076003)(26005)(107886003)(478600001)(2616005)(83380400001)(186003)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-Ch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gEg617DXUysWP7aOfCO95vPxqv8Y4PUEdowKpOWEpXRXYE+wiIMg2Ux3YbPaRX7KC3kpASS9giinGOswVp73cFL9HyHbhaoOUkfqfbL+ShVy+4qy3CyJPaKnfNHYrJKn3AU/oiQPGMmZSy6Q3hUTcZmRmfV1TlOFBpTw6wEnc6C2OirDSaqSYxwrZMfq0GPpkzV8zhBswHnynRf6Hkn5Y7AdUv7X5EQT8QS9l6m1I0Co+eCXvNLtu5HMEb/FgyuNNPI0yjEBg//pVeltBfH1yvnsCuQvfzlPzdnXtKvbVVcIMvg/EbtjKbP/QYhl9tYB4xn8cMhmEJjrc7JArP1Q6+H/uyQK867m87pndYgDrvR+bgNNcNQJMx+C9AyFVZ8qK5giIFb2w5Wgt6kogqyODHY/lPrKzxN6xFlLvXRo0ihrqGJ9O3B59Pt1PmmA2FqtzzfTnhwrZuXHhq2WOY8KE1CaminG4gO3fuY+WwV9uGiJFQQpHmPhQZywIW+Mgg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4385abd-aec8-41c7-db65-08db4596e268 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:10:54.9805 (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: 2i6jh//QjStnlS4POgAajYLYiWojIJenShCs/yALIv0rDVSVo1vn7HiQiqDkFQ10j0gOwptjcX0WnhNL3Ti4sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7650 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-25_06,2023-04-25_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304250128 X-Proofpoint-GUID: FklFDom8mGTOD6g9MWzntqFDJ3R8RRwz X-Proofpoint-ORIG-GUID: FklFDom8mGTOD6g9MWzntqFDJ3R8RRwz X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D2D021A0006 X-Stat-Signature: s9pms9m53mozh7k9534f69tzeaw1w8iy X-HE-Tag: 1682431858-242290 X-HE-Meta: U2FsdGVkX19J9ZO8u9CMdED9q+Q7vZxFw9S7HbB4yc2z8FtkjlYt3xV9ZKFS4ENv/JV64UQs+dDat2cKK2xYUGpy5CDeLQpBtGq8+JEOZrVuG641XvWo/00ksjcWFXdVI3plOFMpO6+MLbFlI5INR80UbDF82SV7VIaGgxnysXqL7rly35p/Y+e1WfS0M3OidG9bDMDjY9a0xCOG9pur5PWuf3m0B/7Ei7rrkthAwSTDMN87UpOJqVQDSj8aoo8fUfL0W+nZg2ebHCCcOMPeLKyWBV2ecdrzD/SIeDkEcoxI0/xOWNSUB7IrkYpx2vlgqW6pWlyEaTZKlb2pLQqmjQpiilec0PwEap4TlmKC3QlRSL2aV+wYm29lFqe3JtPL6/5nqXPtflqG4ECIfVv1ikD6xmfCORgWxu5SGi3E+YPC3v3B66amjcWpf3FbZHb7lZcB4xuQSi9pUSN4pAfqq2y8THBzYZMRN5d36AoLbixaMKW7JcjIz4EdeY2Y4XPqcqex6H3a41duLlwTTmnGCVT/N2ivwwMz9+HLJ1HOtjXLUt63ZEiNyobhYRvHxg43uqjdNhbtv7glN2toS/3Aq0Vn8NpsegeptQ6iRSEf9RSmDmmDpZenJfVacfWrkUQry2+1Ny4oqZGRHagtOf4w3TckLxUsrrOFHTxcNLNAwjTef4BFXE8ktiIHMF7v4FC/kFif//8IK0EA/DUDqZa/eVLbLDBbkw72Ovi/1rWgNjFKRZeCzdrrmdHx/CurrZNF9q1Oh0OhS6NRpoCPTA2NZ1XxoRt4F7ognw94o2I5In12E9cKSipUQkqlw2taQj9vg6alA2xYBnB4xsNTqrFayI2y2nhu41OHBKDuFFA1mtMCC94E6epv9cp7A2ICagS93YmaMh9xuSFPqIivkMJB/df71xY1rU2hVyEzG/lQQoGC8rXU6Yys2cOWyw644YNZkAdxDZXXQlqjuDzwpKF eeomZQrD xZXQYn6sqO2nTuX0Q8Xdex5kTqiBrrN54M2f+yfUKpg07L7okaVhBboUKd7F3FrGoXOgKQtbdTlIR7IFKI9Cb51PCEkW1xWHmAyIf77Sfj4BMmvnB03FblLLQb7Glb46Eusa8Ffj58zeB+SlJwgW03t1LS1kqhSbx7lUuoB6ncV47JrEzOLLonewjiiKbeoz+RPXjJwjDWyMztTePoW7I5KuQ3/EX1z+bQPki96ZzKs5Qtbb1tX1Lb//nHA/ivCjL1rMMy8ZYrw4MnSlWxqVKw8HX7DG3rCLcpp9S0dmSqXcmYZ3sKEG/mgNXDKUy4nJNvIPwyacC5R1zpccmA8hzYPcT7Rvdjvmtq2EQTPhxkVEtYZKfrUfCORlR5hxMmjHNoBv53xxKqhWcVR7q6sjUTAteGXqYkbwPD6L1CeszfUBUoHM= 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: Rename mte_pivots() to mas_pivots() and pass through the ma_state to set the error code to -EIO when the offset is out of range for the node type. Change the WARN_ON() to MAS_WARN_ON() to log the maple state. Signed-off-by: Liam R. Howlett Reviewed-by: Peng Zhang --- lib/maple_tree.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 41873d935cfa3..89e30462f8b62 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -663,22 +663,22 @@ static inline unsigned long *ma_gaps(struct maple_node *node, } /* - * mte_pivot() - Get the pivot at @piv of the maple encoded node. - * @mn: The maple encoded node. + * mas_pivot() - Get the pivot at @piv of the maple encoded node. + * @mas: The maple state. * @piv: The pivot. * * Return: the pivot at @piv of @mn. */ -static inline unsigned long mte_pivot(const struct maple_enode *mn, - unsigned char piv) +static inline unsigned long mas_pivot(struct ma_state *mas, unsigned char piv) { - struct maple_node *node = mte_to_node(mn); - enum maple_type type = mte_node_type(mn); + struct maple_node *node = mas_mn(mas); + enum maple_type type = mte_node_type(mas->node); - if (piv >= mt_pivots[type]) { - WARN_ON(1); + if (MAS_WARN_ON(mas, piv >= mt_pivots[type])) { + mas_set_err(mas, -EIO); return 0; } + switch (type) { case maple_arange_64: return node->ma64.pivot[piv]; @@ -5400,8 +5400,8 @@ static inline int mas_alloc(struct ma_state *mas, void *entry, return xa_err(mas->node); if (!mas->index) - return mte_pivot(mas->node, 0); - return mte_pivot(mas->node, 1); + return mas_pivot(mas, 0); + return mas_pivot(mas, 1); } /* Must be walking a tree. */ @@ -5418,7 +5418,10 @@ static inline int mas_alloc(struct ma_state *mas, void *entry, */ min = mas->min; if (mas->offset) - min = mte_pivot(mas->node, mas->offset - 1) + 1; + min = mas_pivot(mas, mas->offset - 1) + 1; + + if (mas_is_err(mas)) + return xa_err(mas->node); if (mas->index < min) mas->index = min;