From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14ADC4219FE for ; Mon, 29 Jun 2026 14:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782744162; cv=none; b=o5GvYnzTTDJh1TTbaQYllqyhDhojzbtci5ynvhGQ8UEfONWxZeQDIBbhqsF9TLnMy5xs5c6AXetPUFkO/elBVYajS6T+PSjXr6LHxZYyEH8eo+9ct5Hy4WnMF7B4BrI8DNcQi7U1HXJimR08I+8czFMZBNG7PPqFqpAeAKt4JzU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782744162; c=relaxed/simple; bh=Pxn8QYHU5yZ/f/O8j9sNcyAU/mbrpSrp5E8p6wXTnKU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n8s31ykzV3T4Bzqm43h9WOts3ZwNqY86rRzLNO8AsbblorkLmRjAkSGT9Xw07iro1onA2brFV43N5gPpYUd2CWbIEviCQOlY1HYzzEcc9YSLCC539eRemSE5F0+kT39h0BdZhVTJszOl3BpXf7yvxnDEaUv/K4Jh5mMc1ejFyHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=S17asRHh; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="S17asRHh" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=p0Y0c1iyoLH4zFiPixcIiDtiPMLPH+Nu+9iRuZ1+D08=; b=S17asRHh5hcqiM5dHnX2H5HJpm Vl9Sg2oxN7SSfdNSqZANoQuQPKVJKpJLod8QV3oD3TFqBMdQrCYPSXn7/82PoJOf1zvP4Kbs3sZj/ zE7XPnqxTaw9TQA+DLze9n3EdW5Om25W1dwMfbTaJTQl+hSBM2BuWsjcPrD2adpJo5l0+kQfgLr1J sZT7yUy11zYvYqNXZljC5bJMO1+4s4Gr19aDZKZM2fkf4sRemEoOJ5djrcUolroSDfeyGnMdtm6EO /csJFAZsKJcscS55CWTe0S/k8Te/lHukIInJ3UeNbzCiO50ybI7v56TYxVo9P0goYBm/NiI3aVzRx EXjmRxzw==; Received: from [38.23.173.23] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1weDC4-0000000EuYb-1rXG; Mon, 29 Jun 2026 14:42:40 +0000 From: "Liam R. Howlett (Oracle)" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, "Liam R. Howlett (Oracle)" Subject: [PATCH 05/18] maple_tree: Drop dead code from mas_extend_spanning_null() Date: Mon, 29 Jun 2026 10:41:32 -0400 Message-ID: <20260629144145.1572283-6-liam@infradead.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260629144145.1572283-1-liam@infradead.org> References: <20260629144145.1572283-1-liam@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit mas_extend_spanning_null() had a clause if the end of the range being written (mas->last) is the same as the end of the existing range it is overwriting (wr_mas->r_max), action will be taken. This code path is not possible because the only calling function increments mas->last (unless it's ULONG_MAX) to walk to one beyond the write and then resets the value back to the initial value. In the case of mas->last == ULONG_MAX, then the second part of the statement will always be false - mas->last cannot be less than the node max. This code never executed and is flawed anyways (the arguments are incorrectly ordered), so removing it is the safest action. Since the code never executes, it is not fixing any issue so Fixes tag is not given. Signed-off-by: Liam R. Howlett (Oracle) --- lib/maple_tree.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 1b2713190675d..f0aa08902b462 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2993,13 +2993,6 @@ static inline void mas_extend_spanning_null(struct ma_wr_state *l_wr_mas, if (r_mas->last < r_wr_mas->r_max) r_mas->last = r_wr_mas->r_max; r_mas->offset++; - } else if ((r_mas->last == r_wr_mas->r_max) && - (r_mas->last < r_mas->max) && - !mas_slot_locked(r_mas, r_wr_mas->slots, r_mas->offset + 1)) { - r_mas->last = mas_safe_pivot(r_mas, r_wr_mas->pivots, - r_wr_mas->type, r_mas->offset + 1); - r_mas->offset++; - r_wr_mas->r_max = r_mas->last; } } -- 2.47.3