Message ID | 20220616011739.802669-2-Liam.Howlett@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 76AEBC433EF for <linux-mm@archiver.kernel.org>; Thu, 16 Jun 2022 01:18:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4534E6B0072; Wed, 15 Jun 2022 21:18:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4022A6B0074; Wed, 15 Jun 2022 21:18:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22F888D0001; Wed, 15 Jun 2022 21:18:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id EBD506B0074 for <linux-mm@kvack.org>; Wed, 15 Jun 2022 21:18:01 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CC599212E3 for <linux-mm@kvack.org>; Thu, 16 Jun 2022 01:18:01 +0000 (UTC) X-FDA: 79582337562.07.0D65D2C Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 3C51A1A003E for <linux-mm@kvack.org>; Thu, 16 Jun 2022 01:18:01 +0000 (UTC) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25FLpV60029748; Thu, 16 Jun 2022 01:17:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=gTOa4sCsowVfnMdwtik+r2rl6y+WpU7ND9MuGs2cInU=; b=WwbgqN0jBzUCDRGnAFlAXcMr83worM9p824UDNGTRp9FTl1N4uuzO8PITiECiO9/Xcul DJdSEqmGxSxnFTXR/vry5xsBtI5ynC+Oko53ZfD46QhfEZ0vIwvay/o8P89j3lNn2ine l7siedgmFxXo3ILD/ICeykNu6F25AUYvWTzSpUBC+SX3/9P0KvNFw6aNsWfOmfA3hCHP IohsRipHNA40RFG/R8f9vTGKT7jMK+WUFVMNZT+TtMU2QstmHKDLGpjUkdwGECgAy8Xn rzQomfqUCR5LS8Ap81tKyhrBPTpaCjn7qCbe3jam1/raQ22X08FIdBMC+CEvmK4co1UP vQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gmjx9hr0n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jun 2022 01:17:58 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25G1AY2o025240; Thu, 16 Jun 2022 01:17:56 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2174.outbound.protection.outlook.com [104.47.57.174]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3gprbsbqhj-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Jun 2022 01:17:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X4YwK2tcX25HRqp1w5AiU5dTlT6oKGR0tLdzP9a3ezN6NiP6F4FTLWcHTeXjGyZay+E/Jcq7FWLgsxDIeLbUlPS6quTdd5HO3EpB8UG+1lAgkYFkM/LrKV4E+JpRZ87jaYjrXZs9sdiH+xgAhpiuxn4Rt1sx/LzV+eLRRSrq/HZ8lqJEsgclDHOydpeY0KcSmDt8DvzRNxS+xBE7fFLgh5pl4pKBtD+y6tO3enE2vgwkU0MJ13M5wwMsM0FTJv2U+G6yBdVYciEoGwMg7SfO41JoD2EyGh7QIFbnjqbZc+RggZMJEObIfrSAE+CBhAh6ovzYODB1Z6XO1OyBeIBfYw== 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=gTOa4sCsowVfnMdwtik+r2rl6y+WpU7ND9MuGs2cInU=; b=EMoYT0ng021K0ChofsyUVQzTb6EQVyD4BGqTcO3rmcWjrDy4NGkYbDtoAIUMLqUbqHBi8jC/TpY4dd+RtwGEzkPp9SdOndw/zyo8uMC372MqpNxmM7hn0KbdUWR/F5NJotyIagb7U4ana6stxWclUIMzkbAXCloh9NyBB6jZgjjiR5C/OUgMUHKJjK0/ByCL1Oi+ikcivgideup+aHJCUTBFmFgW3XVBO1Bh2N6do//3GnDgETx0ugOEbWSv/IP4t7tqwmULsnjCBjJYtqdmlYQ8eehLCl+r7lkVJ2KW3zopAVftXhXFLRd/NbW7MESpHCpac+X375GvtvzVECYuzw== 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=gTOa4sCsowVfnMdwtik+r2rl6y+WpU7ND9MuGs2cInU=; b=f5p605Zi2FlIR8/dCUliPwoQoN8FqD2B5SqTBp82nudMpY1wDwPLKyQ4h1AQ6+iUHG3X1PSkT2i1OeiMPbnurC0JVKcf69+qrUiCFyQhPV8zRm1Atyu7NMBiSlkT3USqfc9cjEK2A0sYaWH6ntGdsEum9sHetE0i+xCu8LsDXdo= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SN6PR10MB3456.namprd10.prod.outlook.com (2603:10b6:805:d0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.17; Thu, 16 Jun 2022 01:17:55 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::e1df:2e42:6674:313e]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::e1df:2e42:6674:313e%7]) with mapi id 15.20.5332.013; Thu, 16 Jun 2022 01:17:55 +0000 From: Liam Howlett <liam.howlett@oracle.com> To: "maple-tree@lists.infradead.org" <maple-tree@lists.infradead.org>, "linux-mm@kvack.org" <linux-mm@kvack.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Qian Cai <quic_qiancai@quicinc.com> CC: Yu Zhao <yuzhao@google.com> Subject: [PATCH v2 Fix 1/3] maple_tree: Fix mt_destroy_walk() on full non-leaf non-alloc nodes Thread-Topic: [PATCH v2 Fix 1/3] maple_tree: Fix mt_destroy_walk() on full non-leaf non-alloc nodes Thread-Index: AQHYgR7oTco3DccjcUe2xGaJZEub+A== Date: Thu, 16 Jun 2022 01:17:55 +0000 Message-ID: <20220616011739.802669-2-Liam.Howlett@oracle.com> References: <20220616011739.802669-1-Liam.Howlett@oracle.com> In-Reply-To: <20220616011739.802669-1-Liam.Howlett@oracle.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.35.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bdb094bd-4b82-45d9-f784-08da4f360aa1 x-ms-traffictypediagnostic: SN6PR10MB3456:EE_ x-microsoft-antispam-prvs: <SN6PR10MB34560CB217D3FD20FA0EBB6DFDAC9@SN6PR10MB3456.namprd10.prod.outlook.com> x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uFUCRbhoPmwORp2K+tTaRxvGVHRPN5ENehJYSy5Brw9kVWKRkiK7PW6dXvyAqfo6xn1K4voFY40h07en3zOVIcURhOcXcYfSbF+UAdM3BDg/0TV24/3+0vYi2TNMmHP+qNNermSpwBItQ31tcNfYvjAIjOGJ1RGP011DePWxGpx9uiDxCWOSd/4iUdXEeEqGQx4eEUVtWN4sDjrG0vBazfoKuHh0ZQx3sqf4JsiqZ2HQe+1Z90IRTodlrFlHQb54uMYgj3WRWWIn3BDUCqUp2EiocJkh/sV3CEwWgD2ZYS0X3qMIDU45P2T1m3ZOFgGViOU6M32mY9+7g1skzlaFUHdAasqhueF6YBloKrduE5LoFlLfL7G2fqMg6BgaeEIcjQY6sj/WbLYsAmjmM9GocvRIONLK0gED7O5WIX+aMsL8PUE2evLn2yxHgRUOpP2LS2UnYR5HrqKBh0Tfgcvagq4IQSfTk4C8RNyx47CACzPJdaCMjI+nkMjb1iuYIkx9cMuvizVzILElduikkvD13eFmajYePtp3o4kjPlnE0YZtcj03C65zqZ4Vh5Rbo2iWOwkkf+7njTJw5wzJD3TN6boDGRmjALKVJ3GoAn5QrFWeOHFpDUaHClnU0IGf4NOupOM56/bM3oyARxyTeFyx+6Jg3GdJxafok+gQiXn/TdL0WkyIE9XoqKBC8s2X8UvyGFsWx+DgRtvbVYusHVUCgQ== 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:(13230016)(366004)(26005)(186003)(66556008)(6506007)(1076003)(6512007)(2616005)(38100700002)(122000001)(86362001)(38070700005)(83380400001)(76116006)(91956017)(316002)(4326008)(8936002)(508600001)(6486002)(44832011)(36756003)(64756008)(5660300002)(2906002)(66946007)(110136005)(8676002)(71200400001)(66476007)(66446008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?RjpsR+W9HX85NCReePOCfcq?= =?iso-8859-1?q?gRg5Iz8JU8vOT9j53XeAd18O4imi6aHOX7AxcJ4Cte6fVJFXkuZxrQfpFFfo?= =?iso-8859-1?q?4/xVVmbllBmh0KRAHszIwXrPIO1PhpPs7Ht/CnOsusKzJYyVzWje3/4BcWB7?= =?iso-8859-1?q?qfp/bhhF+RjbIW6O4UAr8eOvd4gUdjoNAkjnrSxNrJ4CI+PjjZSn0IRexCVk?= =?iso-8859-1?q?rbiM5YIgnz9kUZKFYyk6e8voy3bKofDsW8FmNvyV000FjIwjaKsOltFjQcgo?= =?iso-8859-1?q?XqruffhhXhF26hQbepBodjKt/4ighxVy2QCCQ2B9meTnzUfYBPBbRoWtrmUM?= =?iso-8859-1?q?Lt/Mwpl4UxmU9laQy9zsMSXeD793cxrf3JJ/h0bjyefu+xVKzBSj6D7KLZJ8?= =?iso-8859-1?q?J4+rbvi8tWf9II/rBl+hzjdSuOXMH+eJ0CwvAKNtTqueUyv7fgBW4xEglX70?= =?iso-8859-1?q?syfX7dvEVeYy07x5ijDebiKYxgSHQyuqoYDJoJanUy0PAi3w+vwUN/DgFIBs?= =?iso-8859-1?q?TQEQoaqJeMg8V0fE0P5RPGkh0033p0Q9YkXbXRA0c6SWUtKzoGzlALPQNdDS?= =?iso-8859-1?q?R8MF1luYyPtfiBeVnyMfJVVhf5nA97OWWCYFZIEP4ZD4wjeOO5a+jqDdZRbP?= =?iso-8859-1?q?q46hSS9h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BtLm9B6TOdCay9B8tmJ9Y/x?= =?iso-8859-1?q?uht3wowZo1uSHhBDwvtvbbtmm5Swjiy05Xf07LPJGONM355q8YpoLyUDmZtS?= =?iso-8859-1?q?0I1F3Vfx8vIcHN01MqkTV0hmP0uT5Z2BjgWI0q2g3WFPn5LX6L4BIHy6FnN0?= =?iso-8859-1?q?wD/pos4M9zmavlVRGQLNEL4perJqdIWj27gseYvrV03xHOXsebvOZfnowy7v?= =?iso-8859-1?q?o/nsAkhx/wrPNnH4Lu6ueWknLn6NyqLa4Z4STDSXX5v1dlsHRPgKE+AnuBaf?= =?iso-8859-1?q?aGGlWUyg=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdb094bd-4b82-45d9-f784-08da4f360aa1 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jun 2022 01:17:55.0936 (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: VPf7czaI440CaYMENE0TM3rEaTCbPai+YeONdB2+Es96tg2CfayTM9Z7f+LTC+2UAc3ivfPn2yJF2Bx4s5glWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB3456 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.874 definitions=2022-06-15_08:2022-06-15,2022-06-15 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 spamscore=0 phishscore=0 suspectscore=0 adultscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206160003 X-Proofpoint-ORIG-GUID: NaYCMUcC0OvvXIrkMoqd5xWpfnEaYL0_ X-Proofpoint-GUID: NaYCMUcC0OvvXIrkMoqd5xWpfnEaYL0_ ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655342281; 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=gTOa4sCsowVfnMdwtik+r2rl6y+WpU7ND9MuGs2cInU=; b=6gTfCXJetl/u2+d6xp3Jk0QXVD8FjbM8WVnRmDw2d22I7CMRz6hR0bXiH1FpU6TTcWTAfl 4wDdpxQgSn0F+xkUxsjG4eqGxww8khYkOWsttTvVD/ClPPDzzm3IcLFTESf1g4SDHT0k10 ciMF8bSnPSIWAN8GFWKTsNspfuX/glk= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=WwbgqN0j; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=f5p605Zi; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf19.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.165.32) 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=1655342281; a=rsa-sha256; cv=pass; b=zjAaoRM74mdn5aeKAm4/ofdDJYDKKDoXBdC6SosobxynOaywJjOv5vvfpNs1jnVmc79RIs udNfvV1uTubvQcp5ln8UeF6OZ7Fd4o/mpNGl7a85QXaBg0ReP2m010zzjAbNjkq1qoDp1x fSpsyXHJqYjdbzGwhnyPRDQy4yzsHUs= X-Rspamd-Queue-Id: 3C51A1A003E X-Rspam-User: X-Stat-Signature: 8bz7bqrqwroxxp7rqfk7xahoq5fqxkkm Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=WwbgqN0j; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=f5p605Zi; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf19.hostedemail.com: domain of liam.howlett@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") X-Rspamd-Server: rspam04 X-HE-Tag: 1655342281-278672 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: <linux-mm.kvack.org> |
Series |
Maple tree spanning fixes
|
expand
|
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 80622741c6b8..a1035963ae0d 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5429,11 +5429,15 @@ static void mt_destroy_walk(struct maple_enode *enode, unsigned char ma_flags, goto start_slots_free; type = mte_node_type(mas.node); slots = ma_slots(mte_to_node(mas.node), type); - if ((offset < mt_slots[type]) && (slots[offset])) { - struct maple_enode *parent = mas.node; + if ((offset < mt_slots[type])) { + struct maple_enode *next = slots[offset]; - mas.node = mas_slot_locked(&mas, slots, offset); - slots = mas_destroy_descend(&mas, parent, offset); + if (mte_node_type(next) && mte_to_node(next)) { + struct maple_enode *parent = mas.node; + + mas.node = mas_slot_locked(&mas, slots, offset); + slots = mas_destroy_descend(&mas, parent, offset); + } } node = mas_mn(&mas); } while (start != mas.node);
It is possible to iterate over the metadata of full non-leaf nodes when operating in non-alloc mode. Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> --- lib/maple_tree.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)