From patchwork Sun Oct 20 02:46:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13842956 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 21B40D3C927 for ; Sun, 20 Oct 2024 02:46:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A6676B0092; Sat, 19 Oct 2024 22:46:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 630FC6B0093; Sat, 19 Oct 2024 22:46:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4AA956B0095; Sat, 19 Oct 2024 22:46:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2394C6B0092 for ; Sat, 19 Oct 2024 22:46:49 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0003A4090D for ; Sun, 20 Oct 2024 02:46:40 +0000 (UTC) X-FDA: 82692442518.21.4CA18A5 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by imf02.hostedemail.com (Postfix) with ESMTP id 3C38F80009 for ; Sun, 20 Oct 2024 02:46:22 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=jK1P2MW7; spf=pass (imf02.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729392258; 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=NEPlZtP+6HEZ7aeAcDKAIgjcSGU62mJCiKqbJmO7MfM=; b=tX3RcjMyLwi0mKE096rf5X7F9xwooIAgtsPAX4Qj6r9QTqwNSjLS3ZFTLB8iQt/ZRqygwF Ejvdg8P/4McjUbd/9AfOVz2eKVDE55UsmPqLVwkhd2p7xD33k4/i34+oO53ty4ZsyPCXmG DZujnpyVdkI0Ou6PhQg0S/lrMiz1sHE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729392258; a=rsa-sha256; cv=none; b=6Gm1IG8wi9TxiyvCehC3XD/eKc1ZjZX00Q7CAJWMCNCOE5joMHaB8KQhhy6QNf9XVPowPY XH8SkWY3UBtgdkDdjeo0IYcF5FpIlUqJfksIZlNB/8iy7+HeMJuj4/bK7wtkp5r5Z81l6e FNvGXE3bhPsA4K6MUPef0ZhxRN01m+k= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=jK1P2MW7; spf=pass (imf02.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.41 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a9a3dc089d8so440531266b.3 for ; Sat, 19 Oct 2024 19:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729392405; x=1729997205; 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=NEPlZtP+6HEZ7aeAcDKAIgjcSGU62mJCiKqbJmO7MfM=; b=jK1P2MW7K1sX7fzJ8/p+qpA48AGcnCjeM9Q+Wbtav2WC/q45KLXCcLSDTjRiqT+5E5 JFw9grdxOeAqgJ/45pdjjv+toWG3cK89yXVev8Xezyjc1ol/3a+hw1r7MLYinj29DI6T t8eLNeuMybBtA671KIm/m8Y4Xo1DUv70T0WM90WMxUBWZXwjKYvGgRpC2+L63KDawY1C SuQyGzwibDn6DIhEM+ydRZJac4VJMpzTpk8SOoPm8Dn6hRFzLEz3tsPxxQRWcH3/y8cu wLeXAYGesSs8qizL0AodzD4qTDTE8RmlIgk8XFRlbYtKTa5eqQTivSjPmagd3K6KUYcT SrNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729392405; x=1729997205; 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=NEPlZtP+6HEZ7aeAcDKAIgjcSGU62mJCiKqbJmO7MfM=; b=EselUSUCDmeFIYyoiQmSdrqYuCt52MFuzFTd9e3mWZedx7zUuiXAyrqGHrgQa23s4a NRVU/mAguC+seKgO+DJ+E2u0MHw/hbfYzOTZRCXwD4VpzWXidkJoe3hYQtGHDg2XQS7k eVaUuQjEtdHl61bov0cZ+hB4qyKkXgUBV6XxXUgaejXBrFqmOQznGxdB1SqwQyNYIrKS Ip1R2nyndG4kxWh4AEEdkjsGQUO6Tk+F1fqvqFqEhbxSEBPwvVnPU/XL1jis8V4f/UAE kshTPbvarBNxRpGl5xPabewnFxJdlwhkb5qqJtGqKmmcXJm3eUm+O+4AjtlOZVYTlOPL tKzw== X-Forwarded-Encrypted: i=1; AJvYcCX0vnN7ePkFd4wthy8bfXMM5qlZRx1Mk22bW/WwihTBEc9B0xQs59aJeL1wVuJAtdHGEPjmc/IzJQ==@kvack.org X-Gm-Message-State: AOJu0YwElDQhOgZqvdVBcQuUMFjPTk8eIB1msNRTeaANw4tCv6jio7/X Lm2W9Fn0myyMq1rJq+RmKvQ+B3KtLjglXZZ6sruisAzxic+/2dLY X-Google-Smtp-Source: AGHT+IH2ROK2/CkAp25C/PTnE60KevPEY93Eqzgm8b0Ypac8xM9DHO7Hctt4iZ7ZK8taGHHXVXZCng== X-Received: by 2002:a17:907:86a5:b0:a99:77f0:51f7 with SMTP id a640c23a62f3a-a9a69ca375amr629427866b.61.1729392405464; Sat, 19 Oct 2024 19:46:45 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912d660esm41905366b.34.2024.10.19.19.46.42 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Oct 2024 19:46:43 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org, Liam.Howlett@oracle.com Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, Wei Yang , "Liam R . Howlett" , Sidhartha Kumar , Lorenzo Stoakes Subject: [PATCH 4/4] maple_tree: only root node could be deficient Date: Sun, 20 Oct 2024 02:46:28 +0000 Message-Id: <20241020024628.22469-5-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241020024628.22469-1-richard.weiyang@gmail.com> References: <20241020024628.22469-1-richard.weiyang@gmail.com> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3C38F80009 X-Stat-Signature: jhzs5c5er3ucgabk4yw93ao5ufkqfybf X-HE-Tag: 1729392382-659555 X-HE-Meta: U2FsdGVkX1/yxDWHKW9kmq+ZfvN+Sk/eJEQHeY7TVGlLY7/DQTD9WG3xBwP9u9iYWR4jw33D1vWwg5mj+7LkL8/4kH6qcIn4MmhPVhLMxsK6ja0Xn3I5hS9RSZIotEyQERknO795dVKprGs682Hdiy3f+dTTRfeksiY2aDBi8tIo8Ki29DxEsuSCjj5C69iWAxDwB0WQnGPgq3zSfmtPQSsA/6jjFTjBRPkLGZfDvtxhlzmvMH0exu2eSMwDu/8qE/XVsi39vFAL+dJ3M8jqOEiCaOdKEcnsmasNlbzTVY5azHMN13gsGJYWNQN5rShFIWNLviFvVBA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Jc2UvrnZtZsKTcE/x92HkmR37WEdWLyn63jFwYKv5VSIK5urwwLvRZr61HOJZyYFnDhuWynUKQEIu0XVNcDTmna 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 could have (max == ULONG_MAX). Only root node could be deficient. Signed-off-by: Wei Yang CC: Liam R. Howlett CC: Sidhartha Kumar CC: Lorenzo Stoakes --- 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 c2d4b188646c..e6b2ab5e27b0 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -7610,7 +7610,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 %p\n", end, mas_mn(&mas)); }