From patchwork Sat Nov 9 13:44:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13869659 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 F3259D5E36C for ; Sat, 9 Nov 2024 13:45:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84FF26B008C; Sat, 9 Nov 2024 08:45:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FF406B0092; Sat, 9 Nov 2024 08:45:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 679746B0096; Sat, 9 Nov 2024 08:45:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 438866B008C for ; Sat, 9 Nov 2024 08:45:08 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id EF21740518 for ; Sat, 9 Nov 2024 13:45:07 +0000 (UTC) X-FDA: 82766677098.16.D67D78E Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf03.hostedemail.com (Postfix) with ESMTP id 98ABD20013 for ; Sat, 9 Nov 2024 13:44:48 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BlBL8VWE; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.44 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731159845; a=rsa-sha256; cv=none; b=uk6zoqRPDS9DgnKbg7SIoaI9KZrLHAQd1huInD887a5XRkwxijFeq7lWmYQ42cJ12IMGEP gAxpPD7gbLZZ2RUDDvOguSClcSVQasLP8gA3kXaMbUJbrczldupUyX/XzOJ+gequUi14Nk H/L/Jtx7xFoN9SaW9f+KKeF4vIDyCr8= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BlBL8VWE; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf03.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.44 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731159845; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=zI2jfEJwFdSILf7CEBjN23QipTbXECNFwz7zpIh5p9U=; b=4V6yl/FUZdZUEg+JCwquJL1pZIWNwvCYsVV0urX6oN6S+ehAqZ9VtXd99Z+7cJoGsAXlcE EhG/RWSNd4PWhQR18jIzQeE85ghznU9FFtNaaZeumUJJVZOugdr6hHTlonEGoGegnDT7uw B3hqCcjfCchvWxSq+W9gXN10tSaTmKU= Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5cef772621eso3590319a12.3 for ; Sat, 09 Nov 2024 05:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731159905; x=1731764705; darn=kvack.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=zI2jfEJwFdSILf7CEBjN23QipTbXECNFwz7zpIh5p9U=; b=BlBL8VWE2Nt2VGULWbgKRvvz8m17H/FELQthikBGper/hytwMCR3815GE22K4M+e/+ 80JNCIBn3PkIzy9gA4DHnwyg6HCOA2N9l/uvoiVFnr41TVmQ4owWiIs3LmhhIo/Y+g7+ qjU1Aa8jbRq1WzpQLOlyelj6TOEnrRwE1eCULzNbqLAUPjvgcbdL86iocTEj+EXM2L6A sfQ8w7iTmlbIowyS4bNX4rFUuJdyIL9qyue03oNv096UgX624ULkdQaAirofAvqCMa3u SgOFFp7hN4LiqewNnWoy+FX9/0zORTb/aN5RreKNVrrs/fkHQhexH05SdA8ZDNEgQ6Zc Z3/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731159905; x=1731764705; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zI2jfEJwFdSILf7CEBjN23QipTbXECNFwz7zpIh5p9U=; b=rOXTbfrMZOVDFFIVtdtWStziOgw8YwNpm/+Kr26fVNVy0odXd6a0HFviXV4P9jV+m/ a0luIYl83Qr5xqNCXpaBEsEsXnCnSO1G12lliFQ7CfYQZIwbQlPa1Pkebygc0ced9Jb1 hBKGIZEVzqPCIM0kdnKkEW5ZH2KoSJufoplNb3J8l91179YLFac6Mx0uGkip+nzJ/8Pp G/3a6U8O4sh5q5Qk3YMZdQuwzWnk+sTEHMSBKDn/Rq9uKaCOVyHsLPsuFVS8yHQcCL1b yfPZ0izyK8zINRHmTPEoApHDDHPxv0YYv8AjUFITe3MWvE6BSdPWUd+1IWVL9MXOh2z7 6qVA== X-Forwarded-Encrypted: i=1; AJvYcCVfqT+eQRFXCFNNEY2zrgEQ315UDWINnZhCcPs0R8O/YykA45gT3rgqTIA1yak2nSpg5tqeqwlVNg==@kvack.org X-Gm-Message-State: AOJu0YwJsED8/ZaLGPPSp05Vdf2IEAKs35SdCHkgqpe6PG7GKZuG2yL8 5Wnun8h+dVoXJVQZiwb4tp0rjRBlSMu8Saf9tBAjCXi6PB9tbpkJ X-Google-Smtp-Source: AGHT+IEN24Fg2S3xV29qA5MKH9OGYhaigtaBp5Zy4eEB2YsLFY9gtVpBc+U+GSS4rE74SKLaJx8iGw== X-Received: by 2002:a05:6402:4416:b0:5c8:9615:3e32 with SMTP id 4fb4d7f45d1cf-5cf0a325cf9mr4886359a12.18.1731159904464; Sat, 09 Nov 2024 05:45:04 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cf03c4ecd5sm2988657a12.59.2024.11.09.05.44.59 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Nov 2024 05:45:00 -0800 (PST) From: Wei Yang To: Liam.Howlett@oracle.com, akpm@linux-foundation.org Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH v2 2/2] maple_tree: only root node could be deficient Date: Sat, 9 Nov 2024 13:44:10 +0000 Message-Id: <20241109134410.31792-3-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241109134410.31792-1-richard.weiyang@gmail.com> References: <20241109134410.31792-1-richard.weiyang@gmail.com> X-Rspam-User: X-Rspamd-Queue-Id: 98ABD20013 X-Rspamd-Server: rspam11 X-Stat-Signature: yeox458hdkqhxro4b4wg7zp8gkaee7eh X-HE-Tag: 1731159888-216890 X-HE-Meta: U2FsdGVkX19euFYJr7733CNiwj3xOg6Qds+/FSi7Eyk67LwHphPwmloQa9UUjL7E8rGOa/OJPuAJqy3zc0h26HI6GjQRXxicVqVq77wAKKwBTEuSZ/in5zDpz21d8blV/+NIL+VgRUUr5oX/hwiZmmpNiuzijFB/zo5vjgE9eahWJd8yz+6DEiRg5uHsv9bwDQzXvOIaTjGEZM27CzslDVypfT72LF8IY+xzgxfkOp3hOFPbGQp9XLj7jSrEaeyjDCRnT2M317KrC8BvZxusTAd1FQGYpPa2yuKs3y17Yk8PVw3TmXpYo067915mm1OfOxB5JCQPqWENwz/ff75m6G+wN5BJmDEbvrY2tqbM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PtyCBb+qXABlg8WqOxA54sH6iwgtFxJUaiG3IH3ddumjDMGsEhOrQq8 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: List-Subscribe: List-Unsubscribe: Each level's right most node should have (max == ULONG_MAX). This means current validation skips the right most node on each level. Only the root node may be below the minimum data threshold. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes Reviewed-by: Liam R. Howlett --- v2: adjust the change log --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 4f2950a1c38d..667326717f35 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -7585,7 +7585,7 @@ void mt_validate(struct maple_tree *mt) MAS_WARN_ON(&mas, mte_dead_node(mas.node)); end = mas_data_end(&mas); if (MAS_WARN_ON(&mas, (end < mt_min_slot_count(mas.node)) && - (mas.max != ULONG_MAX))) { + (!mte_is_root(mas.node)))) { pr_err("Invalid size %u of " PTR_FMT "\n", end, mas_mn(&mas)); }