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 26F2B47277F for ; Tue, 30 Jun 2026 19:08:55 +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=1782846537; cv=none; b=pFoG5cqsgqMg7VYRI81WZXocCBCdJh9Pc3UzjSb86ltREuRBo0Dy4NSWHE/RSGiQ76IsXA5ynZhZidRlbEaysHyr0mmlcmhCjSliE10Ed0021IwmSaVPC1BqQ45L9FNkniOiH/USRbSdHMlUixxDkTPFYMe0klD72oy9wYcOQ5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782846537; c=relaxed/simple; bh=QGlQaGMokJ2uAAub6RNXFK//ThYTdScnpT3Rm3GtfhI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ucZHE+4jO+37JfhZOuV/0Y//PBzMb1kZpTVjwELidcZytjriXM4wzsJa7flaoTw0JoPSmDGz83D8SfcSTmMYt/ceRqYw4q/3ENKGdBh4yhRna2T82hC57WND4221jIqDbjnMTVEcfgPKh9BiLy2fdgOF9kfUc1otR8jPGNAseS8= 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=zXRRsBRD; 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="zXRRsBRD" 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=IBOME4229qFZg2fNmMXblz8s1CDkVlGlAP+BdA0YuZs=; b=zXRRsBRDbqEEnFV4+ht3aD4aro CXLpuCOQY6oMtQV6XYY+kIFi4qCIDanXegTxyHW/bWlhUBGDQA/owVLFhNiPMzdBe89KX8J72mIWD nAN7v/KAt1VHSCD9tHR2uRKWt4SgScEQppwUS42mpN/tJbcWHaSR1+WBZzZhMPh9x7tbxTdvOCqHk O4Nzi97ZMEYbHN76LgKnMByCtw37apL7ze+UNYXNNfBhhITATh5m4PgWf5C2FwOBKkKmRI6fAsKIS Xw/M/QeJzCsyI7giaHN+wkEhQ5Ey17i8uDloOwB7ZLM+Z4/OzjapUsF8DYqqC7q5POJQ81vPSEtmX GdCSPQKA==; Received: from [38.23.173.23] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wedpH-000000005rL-1zXw; Tue, 30 Jun 2026 19:08:55 +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 v2 05/19] maple_tree: Drop dead code from mas_extend_spanning_null() Date: Tue, 30 Jun 2026 15:08:29 -0400 Message-ID: <20260630190843.3563858-6-liam@infradead.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260630190843.3563858-1-liam@infradead.org> References: <20260630190843.3563858-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 e2f7474572319..97849db132e7a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2996,13 +2996,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