Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3900235rwb; Sat, 12 Nov 2022 16:03:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hSbIfF9ReDZb6ASYk2WGibFDjUJfcWz3Mt2HSN8cd8IY2cEuMzfVlX0pM1gO1cXdn0LlV X-Received: by 2002:a17:902:b10b:b0:186:fb90:5774 with SMTP id q11-20020a170902b10b00b00186fb905774mr8150245plr.137.1668297807611; Sat, 12 Nov 2022 16:03:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668297807; cv=none; d=google.com; s=arc-20160816; b=LBzRmRouQ8pRRWSCrWgMM9l91VqLXNKAnHxdGQn9URGgE1OcMFah4/T0tVuPdz2/zZ ZiZrY5dFRU4jFQDaZWR+yDdL7wZaK2yz98leJN+eH61/AnvLzpYEFNjb6W368IVMsG+1 2l64gOy3j3/wrN9ZpkGl+g216boTaSdcjSflkp7vP4Bd6sbw0EMHgq7Nb4EoGMwB4q/e KDqold1l88+mcUcnhbdLQIqzCQWQHgr2PGjr1gf6xCue8vrO5idaD+SA5zNyl/r+RlEX m1JT9sgu7a29rCYhP9GVNle78Dx193SisiDNL068W0kIBCh1zmxtwnGg+Jl202lguZar w3ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=0JAPLUeDBIzUEBdWCKMJoUrcE6eDnC6Knva73vPL0M0=; b=GtpOC/yRc/qzvjP+4d91azDC1HATY4RcWVQE8j9i9tiFWZeaiNBvfRCWVpmYEVuEHe ezNvMY2lKYEG4AQ1m6bE4GXaacJIjfnXjMHh/3go6FShwQU8aR4KsQ3s4+51hmPA8Hlp 6/ui3FipEShfZip4hCclk04gIBipvxPikIeQRYAyisArqVg07ROnfv9c8GimwzDDeiCk LALvc7+9GOxG1w5Cjl8VqByNPYlfSwR2nsTc7RkKhmIUiTfDTtSpehTRmBRWTynxP2qA SQCwlFZemYzl+X0PekVAUPSwQ1EgTurnUqNCuePr/lntQ+zOygocYTvMKvvWTRFL6EEr tvfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CdUBDpjV; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 13-20020a63050d000000b0046e9bac6d84si6231537pgf.453.2022.11.12.16.03.12; Sat, 12 Nov 2022 16:03:27 -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=@gmail.com header.s=20210112 header.b=CdUBDpjV; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235067AbiKLXnQ (ORCPT + 90 others); Sat, 12 Nov 2022 18:43:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231252AbiKLXnO (ORCPT ); Sat, 12 Nov 2022 18:43:14 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60BCD13DF4 for ; Sat, 12 Nov 2022 15:43:13 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id y14so20329154ejd.9 for ; Sat, 12 Nov 2022 15:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0JAPLUeDBIzUEBdWCKMJoUrcE6eDnC6Knva73vPL0M0=; b=CdUBDpjVZZCyKr2IzySbhtUr4+SVpUXmoCvWs6zI2fv5XgzhKsOOQQO1QGgaHAQqdP 2+W/9a8Qwf9/y0ePQJTa3ieAbhztj/K2RlaeEmQNeuvVf946CyAap+aqz9h072e7wQGc vkJ65e5iCKLDm4uTNglOk4NyOIynN9NEqGltRqC0cUySA1gxq4FRy9ZjSrupxv82vIwA gE5uI/ip72wzha473gItUwY5EMQG3+dpirobZkU1AY+v5mjcTJ5cmFkCZt/zsrkTae9u HT8Ez5ssAbTrm1gmIunktBoCP4V4lgpWc6N58LDfJyyZjR0oEAtiZfpfTaTg+ldvOgH+ ofXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0JAPLUeDBIzUEBdWCKMJoUrcE6eDnC6Knva73vPL0M0=; b=OtD5xhKZLMp8ZBAnHv7YP9ctGldTQcj/goJrV5plqYjYmSk4KHCZLlGwGC2af8OAH7 lOhYkuq3CgvBFARb5EbGiFEKtwxkGzUqGcMT5o5fo5boM7fQi8Nk5/MhIdAg3bE7sVbF 818sVYLfmqZgRsWZO6/7UFj1JwlO8bkuN3Ets6uJx9ocT56VJcVMVY1A47rAPeKscmIA CkGsiXyna4D95F2RYv1muNgwDgmqaxBQiPgRzUARmgyGxqDKZRGrfYHZ8BwotYRUwPEG IqUmNstG9mt47PEOncaseex+s8A6E2sMDpUKz5Ami+4Bl1c/oaSRIC1TPvup825f3ztM EMPA== X-Gm-Message-State: ANoB5pngCpC20pw5CW+VG8Tyl8WZFBd0AT7Ukux8MoT7QkeLYWoW8nRG Ejkewcji0otRwGKqrg/SvsB2Si0XHhl0Xg== X-Received: by 2002:a17:906:a1c8:b0:78d:585e:d183 with SMTP id bx8-20020a170906a1c800b0078d585ed183mr6267530ejb.768.1668296591873; Sat, 12 Nov 2022 15:43:11 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id b19-20020aa7df93000000b004587f9d3ce8sm2800189edy.56.2022.11.12.15.43.10 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Nov 2022 15:43:10 -0800 (PST) From: Wei Yang To: Liam.Howlett@oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang , "Liam R . Howlett" Subject: [PATCH] maple_tree: should get pivots boundary by type Date: Sat, 12 Nov 2022 23:43:08 +0000 Message-Id: <20221112234308.23823-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 We should get pivots boundary by type. Fixes: 54a611b60590 (Maple Tree: add new data structure) Signed-off-by: Wei Yang CC: Liam R. Howlett Reviewed-by: Liam R. Howlett --- * kernel build looks good --- lib/maple_tree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 73e2e6434e2f..2123d1930a9b 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -669,12 +669,13 @@ static inline unsigned long mte_pivot(const struct maple_enode *mn, unsigned char piv) { struct maple_node *node = mte_to_node(mn); + enum maple_type type = mte_node_type(mn); - if (piv >= mt_pivots[piv]) { + if (piv >= mt_pivots[type]) { WARN_ON(1); return 0; } - switch (mte_node_type(mn)) { + switch (type) { case maple_arange_64: return node->ma64.pivot[piv]; case maple_range_64: -- 2.33.1