From patchwork Fri Apr 21 13:55:58 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: 13220079 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 AD19EC77B7F for ; Fri, 21 Apr 2023 13:56:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF3B86B0074; Fri, 21 Apr 2023 09:56:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA65F6B007B; Fri, 21 Apr 2023 09:56:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BDA86B0074; Fri, 21 Apr 2023 09:56:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 697C66B0075 for ; Fri, 21 Apr 2023 09:56:46 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 159F0C0665 for ; Fri, 21 Apr 2023 13:56:46 +0000 (UTC) X-FDA: 80705548812.04.AD601A0 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf12.hostedemail.com (Postfix) with ESMTP id A891040012 for ; Fri, 21 Apr 2023 13:56:42 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=bDt4sMlw; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=WzdfU3MQ; spf=pass (imf12.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1682085402; a=rsa-sha256; cv=pass; b=fVGJXpmqXICwROi1K8srReV2cFUIpiNiccfvFZZIM/cAH1u8/SO/f14/NIqyCJK/V4CcFi BOrDYzdLDUasyas8fza6x3lwAOJFZywP7g3m0nEjFrDBzTMwGjakGknt0r5DyFBHgElrp3 g7FDH8/TV0w4mN0JibmSqt//pnZ8HX8= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=bDt4sMlw; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=WzdfU3MQ; spf=pass (imf12.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; dmarc=pass (policy=none) header.from=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=1682085402; 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=7TPHWbKml+7jE5nazbOtx+SnQImpE8T1NpsH1HJMmnA=; b=CJzGYpOb0r60vz9BQMsMd9uLS8ZxKtuZOwKigaOmxltC5eGr7TdvcAvhb5p4Ksh86rmvWu rxH0g/Ma8pH74aE1YE89Tc0xSwFBaIIB99jn8mibF/aOnSqBZzUhfbEXxrHvFrUohw2moZ HQ38bdHJhcG+YDH8bTGq2X9YFJ3ioRc= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33LCYeTk014605; Fri, 21 Apr 2023 13:56:30 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=7TPHWbKml+7jE5nazbOtx+SnQImpE8T1NpsH1HJMmnA=; b=bDt4sMlwzk7CyWHXsADIzSMwsdSwXdWRj3uGCWiAL+gVtbE3uYUatUOLwJ09ZuOCHOBe gKXsbqv699H6Bg4hyRKhANmpMr9R0Xb2Frt1cbkFLHWOW+pbaNOh9BR9bJQoPo6xtBqg g0lnG1FNXrmh654liOOo++Na+DhtPjMfWiBRGxk3TdGZ6R8DzMxnMVdnqdE0x/NH6YcX +DG+r99Q8UuO//BD2SCj9jTgGa8V1BiZBjbqFflf55KNc4bxN2xlnGq4IYHSM+lclo8g YRviS6U257bfc1HN9XlRAYPJKqVMy4VWJrjNuK8o2XADx2YzTaCUemRbDt1uEmmAKo5z bA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3pymfuna92-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Apr 2023 13:56:30 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33LDDfCx037106; Fri, 21 Apr 2023 13:56:28 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3pyjcfpwgn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Apr 2023 13:56:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HaHgisfzmOf7X4t7WaOxVM8LaeeLUMkKMfOOgOSsrkOaHXOPBZZfhgf5iexYfzwl7XmUWE87dQKIyQao8e8x4wMBUiYPWDFZ9VHdObxZUKqQR9xlvJ8igKTKgzjsW7qrIzowkc3aF1DmdEM7s6GD7mL+40A0ixsq66DoA38kd2FvL0Duc9xcMNu/0a7IfJ6DougWeoc+g7Muk8r4FTrFfJpYg9yICn4QRMKj0jKk3TEjaClaWk5Nc7BNOkKWcs9KHq/d1aQ71zZYDJcaX45mO8qkmTVfr8gxzDd69jsoM8knTiqmZhArDoa05tSSFU5lz6/QCtbRJCbeT8PcXu+d3g== 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=7TPHWbKml+7jE5nazbOtx+SnQImpE8T1NpsH1HJMmnA=; b=DoLY9L1Lg8Pp+hLpRV8Kzh2+1McvIRnGDqAEm0Dp1GJSceSWsw+YebqLVkq64HMKeKKHqB391S7A0/oseKycNsSWz+pQPTk53SFGEA5f8sBRv5XvKaBOzvKGB5eZlsOCSc8JovLz2HMmN55ojo7VDnveL0PrOE9fX0mW3oC/ez+uoPpQHZnKikuRUQKkIOXt7fv4rTjCkRn330FUIdPmP5yenMRp5SlcUf3ojzz4c+Lz3wCXPRaasdECB0AoXKoj2K1zzt7G8ZmQVvDz66fSLj1397YC7dzyziQ9LOrIKyyqqtD4WjqhZKz64NHAWKmTdGCeQpvMZ0f+swFLGaAYKw== 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=7TPHWbKml+7jE5nazbOtx+SnQImpE8T1NpsH1HJMmnA=; b=WzdfU3MQMM8yXRo2FMjDDfJwdjyQ60QYu7v/8qqnvYrqaUxhiuLxR1SuGbUZmdw+uc7S33+BTzTprY9Dl8kwu5QauyZTxrSxDKTCKHb0Wb09MvhhdVyk2e2DglGcyILp27ZQzAE82eVVfx3ddpMpS2HNlGSCSvalSxccOLqVRCs= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by IA1PR10MB7540.namprd10.prod.outlook.com (2603:10b6:208:445::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Fri, 21 Apr 2023 13:56:26 +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.022; Fri, 21 Apr 2023 13:56:26 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, maple-tree@lists.infradead.org, Rick Edgecombe , Peng Zhang , "Liam R. Howlett" Subject: [PATCH v3 3/4] maple_tree: Fix mas_empty_area() search Date: Fri, 21 Apr 2023 09:55:58 -0400 Message-Id: <20230421135559.2163923-4-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230421135559.2163923-1-Liam.Howlett@oracle.com> References: <20230421135559.2163923-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0458.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d6::11) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|IA1PR10MB7540:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a7e4c96-1e0d-4026-6c78-08db4270332d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XdahpS22DQUUyvP5taRaU6my1O2l6ezCs+xPa3wT7N64xS9NCzsiQ9/Z4vFetZp7PhhW1eieIKa637P36cAM7i40A5jWH/9LjUBQn0a3KxHq/V8BlVffv/hrtAE6YcweK/bldOtczST2lCUpzQnC3ndLPqm9++x747BonoqwmdjXE73NFTstRyvxmkP1xkx/NhKgqoqtQGdK4996RWPInABWve9JGFzI4YkBG80Jfuh0yjBqsygpEZ3L5b16osvVgGb80MVV/eXZszC5BHDWO+qPJdnimWlKwSOzA2iTOhIpKEeQ1gckZNJLLQo1zs4Dfc+5TdslWbvSN+7M4DNMnMnQXA6e+aLJus6OSHR2SLQzE3aJVmkwt02kprlC/zLZsFBvBor1vKexN3d1LhqfE+SoUS4GxwT4vLb16UM7hkZCirVgQNBSvPLwxZU7eIh0KxJ5+vOLsQTCpRuUdEPNYkkV8w4GzINpuABsK112P6r5uMlRH3srZ3OhkiiQM8XoGxytXppH2cOvLWeVPNod5R038LcORjScO3R8rr4CRfEdv/GK0yQNLMG+662n7Wcv 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)(396003)(366004)(39860400002)(376002)(346002)(136003)(451199021)(8676002)(8936002)(38100700002)(6916009)(4326008)(66556008)(66946007)(66476007)(41300700001)(316002)(2906002)(5660300002)(186003)(107886003)(86362001)(1076003)(6506007)(26005)(6512007)(36756003)(83380400001)(2616005)(54906003)(6666004)(478600001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 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IIsmzCbd4uXAJVUqrJyDI0Qq95elJOryz5rPTIjbvfg2C0KVPso9OQ1DETK7XPvAv+a0BvR7ElGZIm1FU/U2lbRv7Q1Ino12GzqQxuGGA9BlUBXXrThGPlqzfcR1GtbYg/GWXL0dyIXMdmbidX2pdkT29lzNUqfrPVOjnF9zYb4/jwlUMezPiW4tFYHhOYWnx7IO8ecomv/LWAoUNAKqJMucybKCSCn1ZfLulDFqQSxWQbUAfFw+OQtRGNRkrqYTlRZ9WtNfAYdNMY0xfyzzNmMZhU98yM+EY9Pnec1LJeVSTdbHgs9uW/LZ7DhHYiM1CxocB/yjzC7gG6pO2b9PVTPap0u2R+pE2tcnm0/D2p5SwhmIl+RLhcEWTvRBszibCL5HZdY+wuBXnO0NEISh3zSO9T5R3HXST4bZPPy8RKiBHaTn4Z3ru0PQJtxubHytUc6y2iqQCrb2c/A6Us0woj6zgpY0/Q9UTU1bCu9t+pz0rB7uii8tKPjU/Gw/2dOTv8P+LyHRKUYSie4Y7RLBEAI87FucC/9nR/0PFPIY8I2K/g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a7e4c96-1e0d-4026-6c78-08db4270332d X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2023 13:56:26.6427 (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: Bz9kVsCYohCBgtUmm2HoAieKwz5CaLA6l9ZVFNtOjVvIwI4T+3oM4C1xQ1wWwj265BIGjbNLcnm36/bY1wfuvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7540 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-21_06,2023-04-21_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304210121 X-Proofpoint-GUID: XAcGehv1Thb_F5yBuoLg8inbmZcWdz_i X-Proofpoint-ORIG-GUID: XAcGehv1Thb_F5yBuoLg8inbmZcWdz_i X-Rspam-User: X-Rspamd-Queue-Id: A891040012 X-Rspamd-Server: rspam01 X-Stat-Signature: huuyanho1wr4iz1csdsnmw16hcfhxssn X-HE-Tag: 1682085402-335855 X-HE-Meta: U2FsdGVkX19sbrxzxzuLnP+Zrbj1PL5ieuUsdBLzNllOiSjUc51axAD7rGSDX/H9++rLEVADnXSZG7LB8Uahit9M0VZnm3BL78975WJVqd7WAXVo3ZP+2r00bYJ6eIWA72UyWL3m7okFZvzFaieEi4wuZxlMJVJacH6pZcw8jKIQW5xk3arWDxnqO9GxUL9aV9P+jAnY/Y5/InUh7U4+hFW/hiR79IhjiqIwzHcuAAM5nL+488WtsE6FhMHnhC4e72bnLqTCG+ej+rrhxx4rfiGIpsaOPvoi5auC/U4eEF6G/1o2khXliN2TZkwp2rY+ZtiZotiG068ndiyypAo4XnrDMSPpH+9mtqBhBGMRRvkl/qSO/VMfSwHUWW/l+BUgd8jt2mkkPhP42PkahlcHed4w7F0V6XNikIdEXlOtwP0BlOjF6gsbyTKiiG/B/cV/A8ZzZDyAIdqQb+rP254h6jURIWkOJWTrS0kBUZuBUmqWLpAL5ZfSgDOmlkYmxXdLO/ncJTlmDKFpYYo20h67iFzrcKN/ZkOA6PMNwG62mtuoej2a1eoYwFtaWWZyoP8bs9pEzwYxyGsj62QgAFYfF3TIzIf+42zSP87DmdSIpT2wLyQxgqbh1i1FwPQHy8u6Kh8kU3UzbXke0LbNK+ggd2SND3hLUSoN8hgmHH59BkS1kwby5QHQ8tRsNgIw62Oug4dChrPE5VV7uryeL7wfCYiwrTAh0u8+EegJkglTgmxCrPH/ZRtuwTT2rkNi4bMb21oX7Bw/nlDyo0vLTgzk4GmAJhaa2SkrdvP28niSFmXfO+VG715EnnI//KayhYjHoQHOm1sHosOvyA2PqT2m0Ldd6CmvWNDJ+QK9envqUR6nPHIA/PS8dZlpBKf8DOE2m2fIyMmfol9IYCBX5Dm7stleSgyyjsS1uVdoswYrR62mK8umAmEPOjPVUHdDXn7UBOswVaiauaUneSqLLfi Jiqo5G7y Cv1zCGURQetOn29uLuqaOlrnehKdOoYnmyu9NvwLPKyU9aIuXLwLceJm0MQ9u7tJsvhEZu4mVEtqFW36WxjPpvKHpdA9MEc+kJktvBFYS42DEqzNZsZbP9jI1/AVVJQb1Lq6bVf1ez+ENN5hbUP1p5RejV93tqu1UTPPbpAHljusOPoeXbFPdvgskhoZRA7dFGzy8GN3Wdm2yHlBLpAoW3MrQhFJJmTzEyBXe5A5M4sfL1IORF/wKZsyrvPU1rNY9Q8L13s9c0iTlwh4FbejmUBvg1ROvPxZB/6W0ugIJPdI3jcjV1dj6EAYAgRPVlkNErB+zYQlCgoOyyl0C6na//Kxilb61t+QbDmpiOMUC/hVX0RXlmwyRqCemwdCLXC+4vYGmwXykGegHD5hfW+IJLweA6LuSTU2ayce/8tzEdXznezo= 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: The internal function of mas_awalk() was incorrectly skipping the last entry in a node, which could potentially be NULL. This is only a problem for the left-most node in the tree - otherwise that NULL would not exist. Fix mas_awalk() by using the metadata to obtain the end of the node for the loop and the logical pivot as apposed to the raw pivot value. Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index cf4f6cdcaad38..51910c74d4895 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5029,10 +5029,10 @@ static inline bool mas_anode_descend(struct ma_state *mas, unsigned long size) { enum maple_type type = mte_node_type(mas->node); unsigned long pivot, min, gap = 0; - unsigned char offset; - unsigned long *gaps; - unsigned long *pivots = ma_pivots(mas_mn(mas), type); - void __rcu **slots = ma_slots(mas_mn(mas), type); + unsigned char offset, data_end; + unsigned long *gaps, *pivots; + void __rcu **slots; + struct maple_node *node; bool found = false; if (ma_is_dense(type)) { @@ -5040,13 +5040,15 @@ static inline bool mas_anode_descend(struct ma_state *mas, unsigned long size) return true; } - gaps = ma_gaps(mte_to_node(mas->node), type); + node = mas_mn(mas); + pivots = ma_pivots(node, type); + slots = ma_slots(node, type); + gaps = ma_gaps(node, type); offset = mas->offset; min = mas_safe_min(mas, pivots, offset); - for (; offset < mt_slots[type]; offset++) { - pivot = mas_safe_pivot(mas, pivots, offset, type); - if (offset && !pivot) - break; + data_end = ma_data_end(node, type, pivots, mas->max); + for (; offset <= data_end; offset++) { + pivot = mas_logical_pivot(mas, pivots, offset, type); /* Not within lower bounds */ if (mas->index > pivot)