From patchwork Mon Jan 9 20:58:20 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: 41147 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2384019wrt; Mon, 9 Jan 2023 13:14:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXvpTQIGyfHZjfXE3V0hyG7QwJ8wJUwiDGWjaY7vpfyYyHCq8JjOaVl3pz5LnXP5WbvoMw20 X-Received: by 2002:a17:90a:5b08:b0:227:1214:e7a6 with SMTP id o8-20020a17090a5b0800b002271214e7a6mr4735268pji.33.1673298858049; Mon, 09 Jan 2023 13:14:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673298858; cv=pass; d=google.com; s=arc-20160816; b=BiG/5ZqN/SPOcC+e7mAxLIov5G3seKcbbrVvVvluAqNOLyg6LSmKjQ+o1N4WJRbkOB Ne91drFk/q/0ji7UG6WarRLWyEnVKLd1PeoI8Yj+pQDPrUn633DPW3hLksYm0/yKXZD7 wpw/rJsput46MsyCv1lOWXiHkeAS+OoyOTSzVq7qlyFkd3rKHJqUNK5/lGLwWEwQ+p5h WTeAasMZ30iWlSGD6bDjr4z85TMgnq0wu7XlpN15QpJ4MFcX17f2EFO18krhhkyZjswJ Hw86AHI8YsWCVGRoebqchRMVTKW152nHrm44oixJ1RRzmKseAgUPomirrGa+ymwp0oX/ XTBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:dkim-signature; bh=bWrCfCdKYEn2Sy8wjS6h0YtOWFcjL4VMOiaqeSRsvf4=; b=K2qI4wGNU5loGE4xQAB8QVoRzrX59bjnRezOWEA29c7lzBTlNfKPj6Th5+kbjbT185 d6EJKGJD2eUOf9aSYeWFGKq2Yx+afl+nKe1fsi/gvjeqwcCNZKjLB8jgS4B0o6KX4e7s i9G/jZ0U+Kkq9Ys/ly7be1QPjZiYelztFx+v4OvxGLFWyNpnR1Z9O38Ro415mHQZkj8F FbwWxbziToOGLlOzyFz47xo1rh6WWew0cmuyfTGiuhCUXvfNDsoSDYm+6VCXIS1xaFch ybBc9D4pWj6bMmn0GZNUsYIxV7A4h//QvC+1bcBzjQelIXJ6UBSgI65g1Lp9EQLVNBJL m/GQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b="p3m/eQgF"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LUWTqi65; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oj8-20020a17090b4d8800b002266326b49dsi10718464pjb.158.2023.01.09.13.14.05; Mon, 09 Jan 2023 13:14:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b="p3m/eQgF"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LUWTqi65; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237984AbjAIVF5 (ORCPT + 99 others); Mon, 9 Jan 2023 16:05:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238056AbjAIVFO (ORCPT ); Mon, 9 Jan 2023 16:05:14 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A49F08CBFC; Mon, 9 Jan 2023 12:58:33 -0800 (PST) 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 309KjKWA010089; Mon, 9 Jan 2023 20:58:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=bWrCfCdKYEn2Sy8wjS6h0YtOWFcjL4VMOiaqeSRsvf4=; b=p3m/eQgFU30yzx+Htb93dO2SeUcB6xt2jcY57GG/Vjol8QhVGaxV9AK8h5/zMS5rCrG7 /AYyYl3mb6sxDdcDrhjKScqUBMuolTyWLsKWrhRjn4z7gi16ZNBUD+27WYIQlXRdGUzm YyvdnUyBnMAfEmFhjb1PLostFJ7Hkj9TS8+s6Vwm5fQyo/LlLBzS7cLWmmOHL1p7ziXC pZDNoic9WfWGWh3sLodR1NqhH+4+KFcsNx3+N2E5StfskyIRqx7TCU54j9KmPfNhqX4r DMJhx8KBLxGBNvWamtXBKGIwXJ7+wlA/Ps5FCxpVju6cijiJ7lYcOm/Hx9uwmlv0TZMs hA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0btkq51-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Jan 2023 20:58:26 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 309KmGhs017446; Mon, 9 Jan 2023 20:58:25 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mxy6as838-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 09 Jan 2023 20:58:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lvgBxw6YkXYB09FKgMC2SiJpTVOG6UCWDyQfmi4DCjRNILgrCPd0Fjckz2NKg1c1z6YUNokj4+S9Dg8r7jcuFNMDwM7ipnT9WLQvCE6ImvBUv9IEeU5Pl3aene9mLWmbJHd6KH6Xryf1UE1cQ0TfrsUjuZLuC6RbI1ycqwM5v8n2orIEQnzg69CXI+tfzN+by2oIg/8nqohD/P/QQPitBnXskA4U7Bgn0vGYAJkM0Du/tm501eg3VdDTLx4NpDXM5+rqr2Q9Bv1jKylnKiVJ8U+rHjSgfjmhTQjWDQplSCGxfjJhBHw2wblXt0Hj/LybnKhN8vHPdaQGAxdUmUseag== 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=bWrCfCdKYEn2Sy8wjS6h0YtOWFcjL4VMOiaqeSRsvf4=; b=cwGS0vEi/EZsEKiYJvuYxh61hT5gE0BPw+7aE5/3uSgAFZKNnykWxEU6+vu2qHpzxmjoMz+drah1YbacU47XZ5WjQaaDzdjc5baoMoeC+4Lf6cT9esv6pEqls3q2oJYcrsU2rpakcFPmJJvlkHMjmG30HdrCYTc14ksJPS3C3sdvGiI8jsbV2jl/4UfINa3HIxsRsekQlK/bTYmRNbRdUxVVCAhF0c6elygDLSlLKoHBhE4fHhrRoM7mVu3ovDdcjlyn10AXroFRLu+3GY96zdqKgrej3mE/GIB2lLWnD4CFP8K/5MQ5O492B7ejonRSZoar41RNXGZTgKEoLvOFjw== 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=bWrCfCdKYEn2Sy8wjS6h0YtOWFcjL4VMOiaqeSRsvf4=; b=LUWTqi65qfcOKQgBp9MJITp4YB77UYF8rNqSqL78MEOBdoh+eu2gf4z9LN+JH2QC+5ADe8tk2ofLVS7lX+JdCXSisVuzdpzoLRBWuKOxQQKR65fELzEIzJkM6o+vwFCjosrcrTUA5/HwbyE5sJEfHbG10CrDXHv/K7szXx3v3yg= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by SJ0PR10MB5860.namprd10.prod.outlook.com (2603:10b6:a03:3ee::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Mon, 9 Jan 2023 20:58:20 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::a02:2ac8:ee3e:682]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::a02:2ac8:ee3e:682%4]) with mapi id 15.20.5944.019; Mon, 9 Jan 2023 20:58:20 +0000 From: Liam Howlett To: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , "maple-tree@lists.infradead.org" CC: "stable@vger.kernel.org" , Liam Howlett Subject: [PATCH] nommu: Fix split_vma() map_count error Thread-Topic: [PATCH] nommu: Fix split_vma() map_count error Thread-Index: AQHZJG0amtZ+KWpE+0SrLkRBQDWhyQ== Date: Mon, 9 Jan 2023 20:58:20 +0000 Message-ID: <20230109205809.956325-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-traffictypediagnostic: SN6PR10MB3022:EE_|SJ0PR10MB5860:EE_ x-ms-office365-filtering-correlation-id: 8faad0ae-7c99-4ecc-4f40-08daf2843d77 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KnZ7nmcTY3CfFDLGBV88zo/8XUdQrKWtpU5ND4/3kitXZLsPxn+2wJyJL+41S0AfVWdsZXLb+A0GWdVPnH7pEIZDjf9NcpjG84ed5tqHPfYVhcCV8EgDwJK018ANnATkd9MYp8VqHjhJd6FJzvPaMA57E7VAXHvFndNAIHNdTzIOp4ZSEBaz1nARTOWCKhvdBGOlKnh+sj6WvWb1qQt9Sdz6MqcgJAI4r39jaW6+urKMy872Meby3krTJM3JuQMSN7MCrtgVzhP1dhoBuCS8fEdcW0Zj4T+ExGk3rxPQaMjFaLSf4fZY6eWAGFPu886eJ0UE4kV0zw4ThYkG8YM7bb610pOwpHHyVnfxg6a6kh3zM2y7W5miTV64fQFbWAHNUZr3wAJd703bdeapGLzci+oLo/p03k4Ygf+GfZhnVLNLELEM8VYtR2CmwIPDJ4YYcpcBE0YtiuWAR2KyCdoDyTmF2i7VBnfYEYsIjpVZMlrQByf34D//Em4ta3d5IrZ3ofIHlrmSGz18FGH/1glxKPo4bGSff/oePoV6M6v5PG7/SGTuqRvmwvhEDDVri4Tdp0eOTUU9fIqhqiePyHWltr15D5oNY00A22TRAT9iD1nE/2RSA58rQ9u+1sMbvVjyHlOovO8c5iD0rxOxB/t7xh4M+ge+5TXwXKQ5fcDCsli4pIlzBocm8z/yLJq0Fk35fUmIY2v3Oqt80NBKE0OI8w== 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:(13230022)(136003)(346002)(396003)(376002)(39860400002)(366004)(451199015)(38100700002)(36756003)(2906002)(8936002)(5660300002)(44832011)(122000001)(26005)(83380400001)(6486002)(41300700001)(54906003)(38070700005)(86362001)(76116006)(66556008)(71200400001)(66946007)(6506007)(110136005)(4326008)(66446008)(66476007)(107886003)(64756008)(1076003)(6512007)(2616005)(91956017)(186003)(478600001)(316002)(8676002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?FdonuaQLa/pZ/KZTNsTcPxh?= =?iso-8859-1?q?9wFmcP+JryTC5CJnjCZy4cDdpnlHa6Vel6P8IhPmbt5RDDV8c3xMmtzIa+Ju?= =?iso-8859-1?q?3fbLxTQkqWleQ27BeGNWTDxmkcLxsFPGUfAOr0BTcDSaXYNy5Ju8a7PIGj1a?= =?iso-8859-1?q?Acp9jblVu/U48REd2aC+Qdv6jcerm5ovdKu9A1SJw53UFeHRrNhncgeRAx9v?= =?iso-8859-1?q?zUN2ILhqytLrXz0dRrXucl8/pMFI88PpLbtVmmkp//NE0U6lLriZTI2btLlE?= =?iso-8859-1?q?1KyEOdMhyQyZ91WA/QZu0QHh4ahZz9ysCFR+ulOLJsnbGYlZO3OHvg+zJQdp?= =?iso-8859-1?q?dFTlCO4qyw9OIkMEwccwWg+J3RzbT9HD+3ooBWMLfH+NOvOpN0bG+m+roKMD?= =?iso-8859-1?q?1Tt2TdRHwk3+JiTVMiD0ljDxP75fbcUm2LP1ypMFvh/Yo5Gih5zx4NVgScxm?= =?iso-8859-1?q?cN05zaFLgPjTbhxP7D4QJymEEnK+Fr3qzUBNIOfHFVGOehrKiXZlwdSv/0Y6?= =?iso-8859-1?q?HfVt6oyD8PclJe2p7OxRIRq7a57im7IBe4zIwhbAmh6h3tytclCtemEBPyI6?= =?iso-8859-1?q?Vgw1HG4R/1vCy8GetxxSb/XDKlm6p2HM+BIwfUY0ZK2E408tSukrzfo2knOi?= =?iso-8859-1?q?UTIF3NRsY8bS4BkHGaDDKrR5zHK++7n5F6WyKmq6THMsYC6JnpliDEdbrKZv?= =?iso-8859-1?q?28wYr20HvFYgicr+SuSngNQ9RxoDcm447SptR6T5jiP53S7otKtlJ9yJ4+Hn?= =?iso-8859-1?q?/r6zJ9UlYSScowyKHHLF+R6S8fmXGqpExAmoIxVFQi3VqVlf3/NaImZXxSjz?= =?iso-8859-1?q?m/Yx158ACb57nE8/wb5lTLC/uKiFeLwdQuDozqmwQmzfH93HrROEW/3CGaIr?= =?iso-8859-1?q?XRHs3T024FpC7+saL8SygXo9pywrsTO2T29agLKDSTtDQZ+KMkhl1bortvrU?= =?iso-8859-1?q?Tsux+nNivFYqn9JuHR+FuML+Z5ccUehHTRe4M8xgbUx9TRCBx77ibz9qtmiX?= =?iso-8859-1?q?Bk7Pop3gX6urW3zHonhdii2gOZ3iXeBQmirSqVx2ROdTJLvLZHxAADjVItPm?= =?iso-8859-1?q?CqEwkspt7NmfAR+tHeXTTyT5nOZ9C+7a0TILOhhuLZqIpyufhrrOgRuWqN8m?= =?iso-8859-1?q?uBRoZL1jDxu8PaYkAm2BgYQePt0YJ4nsQIYncHR7K/iBri1qsgDCRreqjRD1?= =?iso-8859-1?q?pbounKgnvKgJk+rzbGy9DWuZ7r5+ncYRiy9gTk5Tb4igNKfyWT58SNPXJff+?= =?iso-8859-1?q?UxFgw9/vgfH4aK+3MtN7Tpum3Ym7qd+SgTYs7MEpUq8/Lqii8+N3h1mkdEc+?= =?iso-8859-1?q?A3LN/vSMt1DkecTfLhvYfnnhvvagwZXkVRjtkk47Obm3uu83K+2BET/tMz9c?= =?iso-8859-1?q?jdtUUfR+BUjK4S9SG8YWO8eg+30RlJie0deT0xrrcSvYJCLwQ7QMDN35a/ZG?= =?iso-8859-1?q?XXn6eX3x6yS4zBs8zOjBcrVxVs1xEqbTWu+rCTK5H/GS7VyO6QX4C2RF5fuU?= =?iso-8859-1?q?hNxtqWv6w2CTcZdspAkHKmcybr7R9Ep9IwvU0OVqH/Ww9U9xuCGuR/B4kIgo?= =?iso-8859-1?q?pel6BOyskkefCtiMUokNsLe/6lPGMQHCWJPc2jr6Fj3+6UY56C7MgxqtcXPz?= =?iso-8859-1?q?VLZxo9vI0RzxnyLGjLmsF97QGibsVYFM8kpz/MA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?iso-8859-1?q?HuQwbEwqH8j?= =?iso-8859-1?q?bhqaznerNKmXwQULqoc+PNixJggas7lIJoA4z7dFGQ+rFooC9zH357nijzTq?= =?iso-8859-1?q?a16aBh7YUVNo1p8t7AT/IwSqY+09P5xX1gMbinnQj4ATYiSVluIWf0vPsXE+?= =?iso-8859-1?q?12TlcwajKiCChjGxcETSWXwhdI57DBe/vZkjHA9G32W/WP7LXelm5rQ5jVqq?= =?iso-8859-1?q?f5x7V0E0sCI2tc5yDR7bHyj/knbSn2f19zC5p6I698528TsA5TtWrOS79DRx?= =?iso-8859-1?q?D2eitfwMU9e6z2pyw77NK8D5D6l88JSYyLR00clOPfmuY8ar4o1Iqg1s6UJP?= =?iso-8859-1?q?ameyF0eAz7B/3pZBA9AYhjDu7oWA5OTy8alKbXDetbZVTnP327rIADhLj5vg?= =?iso-8859-1?q?f95XkqqkEv3nAZlT33VC1TyTTodgZGYtJfl4HN6skpA4IfbFFJJKOlmWg0uN?= =?iso-8859-1?q?b+QZwsQOfZ1Kci6Rn5lDRkU75gKLZALFX+8G2Z7JgDXB8zgkcibBZ1Veexp0?= =?iso-8859-1?q?vLVBmeQZCk1bWV8/ImwdQeY+S1q1PbQftz8r0DYwncQWtEpuHOpDsr6F6ilo?= =?iso-8859-1?q?/g2caDvIU7qRCO0/seI5/XSjbLeWEXnit5pNp/K0eWsuPL9nK/WEDTSePE5E?= =?iso-8859-1?q?IzVMuYMLUlNt661JHpAE1ICRE7MW3JPoA8xkwG+VBngz5v+9FMtkzrVMkmV5?= =?iso-8859-1?q?nUd7PC+GLzFCvHCui7ETNyEbvXYmAhHQyJL7rYRflTGMj6IN4WGX55i1pV1T?= =?iso-8859-1?q?fzyDHsa7HcTjYLVmlsZyCvUfMPSJsv4kLCpsCYL9OmEr5s5xdLQ+Cml7pYhG?= =?iso-8859-1?q?cDxT1yC1pawm4r/QARiKBl/fMeGaB1gBRUlkhjbZ0CrVybT1gqqsVPd1T+Vs?= =?iso-8859-1?q?KuGgHrnZ7AyVxh9/dnLDNfN9tuBuVobAlyxfo8Ydkgl2LCVgH87U4JjpNq3C?= =?iso-8859-1?q?QGCbEWAVsd/EccrSbMVtCmD4nTPaok3HiyxVxoYoqJrUj+bE8?= 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: 8faad0ae-7c99-4ecc-4f40-08daf2843d77 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2023 20:58:20.6711 (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: 8nGuie1xl/PoBStD5JzX2qjRxFnhOiHVVJ3IkWfzDd7769vYOJIXdkZU3GfSu/rajHV02WDqfQDQflVZBaf9yA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5860 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-09_14,2023-01-09_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 spamscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301090147 X-Proofpoint-GUID: VSnvJuw5ELok45XAnwc2Q13ScVV2xlxP X-Proofpoint-ORIG-GUID: VSnvJuw5ELok45XAnwc2Q13ScVV2xlxP X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754581023543379823?= X-GMAIL-MSGID: =?utf-8?q?1754581023543379823?= During the maple tree conversion of nommu, an error in counting the VMAs was introduced by counting the existing VMA again. The counting used to be decremented by one and incremented by two, but now it only increments by two. Fix the counting error by moving the increment outside the setup_vma_to_mm() function to the callers. Fixes: 8220543df148 ("nommu: remove uses of VMA linked list") Signed-off-by: Liam R. Howlett --- mm/nommu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/nommu.c b/mm/nommu.c index 844af5be7640..5b83938ecb67 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -559,7 +559,6 @@ void vma_mas_remove(struct vm_area_struct *vma, struct ma_state *mas) static void setup_vma_to_mm(struct vm_area_struct *vma, struct mm_struct *mm) { - mm->map_count++; vma->vm_mm = mm; /* add the VMA to the mapping */ @@ -587,6 +586,7 @@ static void mas_add_vma_to_mm(struct ma_state *mas, struct mm_struct *mm, BUG_ON(!vma->vm_region); setup_vma_to_mm(vma, mm); + mm->map_count++; /* add the VMA to the tree */ vma_mas_store(vma, mas); @@ -1347,6 +1347,7 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, if (vma->vm_file) return -ENOMEM; + mm = vma->vm_mm; if (mm->map_count >= sysctl_max_map_count) return -ENOMEM; @@ -1398,6 +1399,7 @@ int split_vma(struct mm_struct *mm, struct vm_area_struct *vma, mas_set_range(&mas, vma->vm_start, vma->vm_end - 1); mas_store(&mas, vma); vma_mas_store(new, &mas); + mm->map_count++; return 0; err_mas_preallocate: