From patchwork Wed Nov 13 03:16:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13873133 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 43D2AD597D2 for ; Wed, 13 Nov 2024 03:17:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C78ED6B009F; Tue, 12 Nov 2024 22:17:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C27426B00A1; Tue, 12 Nov 2024 22:17:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7BEF6B00C2; Tue, 12 Nov 2024 22:17:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7DD1A6B009F for ; Tue, 12 Nov 2024 22:17:05 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3B9B21A0734 for ; Wed, 13 Nov 2024 03:17:05 +0000 (UTC) X-FDA: 82779609990.14.038EB09 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by imf27.hostedemail.com (Postfix) with ESMTP id 1DF3640009 for ; Wed, 13 Nov 2024 03:16:19 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lmPvkwxe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731467760; a=rsa-sha256; cv=none; b=6CqeC3rw3gSdsgx4b/21FjmAN8V5bbUUvE5p//WyTabRRQn7c+7x+FGv6re16Mrxf37kPz jXH47TDg9hEbpAJlsKrM8JQp7lmqjE4RCNPo98gOEUHhLtVAxMdif6Y8KLCFFRTNMnfelY zRgCsb9YY8yESc+dznKqDOMrL2y19jA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lmPvkwxe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.221.41 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=1731467760; 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=lJ7HTuz3Rv2vEaHiKIC8XdXmD+QLTTo8xZwxCH639FI=; b=5KD17x9EFfmuvxOs4hLn3x5kAQ8YJDeQMxgstlj77M8lE0FF2tB20IOW45hsXnVBOr85Zo FGM+gMYShfsAmzebsEF5qJPe7HtLJiHNzhzrhFT+3fRuhGqpQyQZUB4NPoivveaurBEicA a7gFm2hkFw/Y2wa38hO3FI50xAZbcPs= Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-37d495d217bso5772747f8f.0 for ; Tue, 12 Nov 2024 19:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731467822; x=1732072622; 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=lJ7HTuz3Rv2vEaHiKIC8XdXmD+QLTTo8xZwxCH639FI=; b=lmPvkwxe2d4rwYQ5M1c5N/xmOMASZHGecni4MJcCCpg4btZx0Fp7oinT4aHaCuublf 80Ee8RmZXu5hXGbbFEoCmQx0K6+BYmqs2q42bm1NMuT7D7dfPVlaBWrbfGujqgotBrMF ts/TMBfWHqol6X0TgiMm+fkmUwTfwNFoHsoDUxbg0xhqTRw75dii26MzY8+OdC1Q/AxJ Rm/OnJkDB8OkDUpp6+dBq0hz5AyJfLImngcricGXWCtrGFRyYuqv2IvuAVPNAbQifEXa wfGo+NPYJmuBQMDwFGX577ORRJeWWSptgkRkbpAirJx7/1GZ7n3YEHmVtb3ZVQ1jfMUE h7ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731467822; x=1732072622; 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=lJ7HTuz3Rv2vEaHiKIC8XdXmD+QLTTo8xZwxCH639FI=; b=oAdkRdhZ3F7yLrAApiFurgM8xKoiit856UD/o8Epk4SMiahMjcevnf0zfXu9xntLJG 6qox9xTI++ff/37btBnymNep8d0NS1zCGZe2uBN5coPm20uwtwMdhaNWjzttZ2ZJyhs7 9PeDA4sc4JrQi60jdyw4Nd2ZNCpbyD/KWyuPON8o+Ao/WSvpMkrhFfC1B8O4TGqbWUp2 FVgk0c6e0gajYQm8SBpOrCF0HzV2MEeDsuV9UjSfnT6fCjmWrZQxx1+cjd2JCf4LMAcQ am0nDokT3lVi43mbL+IyC9WhqqxPCPESnM46BG6L2MyHrFKhVODp7+WBE4D6Uk77SEZf PH0g== X-Forwarded-Encrypted: i=1; AJvYcCUhs8q2Hwnl4QOCUXEdNq3yBkJ0It/nbJbIliOO2vle6e27/hhmgBPOIUPS5qUab2x8RqfhSjfjiw==@kvack.org X-Gm-Message-State: AOJu0Yzt2U25foJgGN6yFwSp/iwc28Kx45auQRXiPCCh8jAKZT7FC4ie p5SelNfNiMxR81DggxvxdEXDJzLQhz8Jzyrchhajp4MYKWEmaxfe X-Google-Smtp-Source: AGHT+IGAUWoLA0UyyIuf1kZL1fMAmyZtXXP8DIeO+vUEBI0jC++vATblxM24SA3vDcpC5iFYUHKcmQ== X-Received: by 2002:a5d:64e7:0:b0:37d:4833:38f5 with SMTP id ffacd0b85a97d-381f1872349mr20321029f8f.30.1731467821924; Tue, 12 Nov 2024 19:17:01 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0dc4933sm798476666b.99.2024.11.12.19.16.58 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2024 19:17:00 -0800 (PST) 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 v3 3/3] maple_tree: only root node could be deficient Date: Wed, 13 Nov 2024 03:16:16 +0000 Message-Id: <20241113031616.10530-4-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20241113031616.10530-1-richard.weiyang@gmail.com> References: <20241113031616.10530-1-richard.weiyang@gmail.com> X-Rspam-User: X-Rspamd-Queue-Id: 1DF3640009 X-Rspamd-Server: rspam11 X-Stat-Signature: zw697t7bky6x5cxghe3fx83k41miwed6 X-HE-Tag: 1731467779-79649 X-HE-Meta: U2FsdGVkX18pm4u+l6MmaHA7w12D1/f+g9SkKs1yk6ipH6l3xpJGGirM/eahUlGn3Oq+/w971i9pmg8GgeUYttyPts1ToCoFNoPHE8vuWXNZ7VPa4BVfBWC1xCnhuhCNJ26imhpWNykxivqT93EJ+4Y40jJrPmfGCMQOxn6JbJIMlKv7IcQ9n3WRpTWX8ZI+tCitOTV+z5FcbwPpky1kPY5eesXSr4HxROlO+McB7y2/E5BKMq5uB2Mznq0cYEJkxO9RaS10JgmiRhsfvVLlYZg9p6YGsS1he4Q8UDUp/3A+uyTFYze+aViRqi9Mn7VJFp19bnBgG3IjqgbZOtZrS2PZjhXu6HI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5E15K7waMcbuSNoNuIfgqry9nv60YKIZwo51j1+HqnRq9XhbI6LGQ 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)); }