From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1552F34AAEA for ; Mon, 23 Feb 2026 07:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771831535; cv=none; b=BQSyOl+FRAthjVSdbZNrMm0vn4gOntlwpTS2m6gP8NBrXJbeBma+iDnTaDEP55WPcr/lZOgJifYojpJ9/ioJvmi+oGWFJWfiAqV/d3pMYq+X6cuk/nD/5s72hkytXa64/664IAXvyDanV7Zt8jUgPzXt2M6KgfU61AEX9sq4OWU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771831535; c=relaxed/simple; bh=3NT0l0ZKmTs6WjvKVLQ+p7YW9ogqw1ZJ9DDytU97MkA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Y2/X/6t0GZYt7hopXn6VAKVRzYMNL59begSQ7Wuro7NBw3uWZf2/5pwika7otHc7Kk89uNSOQbnOY0aknHV4y6zubYFhvFRm+mf6TMBVf4/w+aYf9hLHtLj2QrmGBJNf8q7K0A1HTZXmyIK3sLRRbj8raOgBQacNVILwun0/Q8k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ackerleytng.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=lr5N7cWY; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ackerleytng.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="lr5N7cWY" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-354c44bf176so4031619a91.0 for ; Sun, 22 Feb 2026 23:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1771831533; x=1772436333; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=hidpuNttSwZHxHCys+Rdwk1AShkIe4ps5Ps0hErcBKQ=; b=lr5N7cWYz8ua9ZpWx3EVPTnC+gpTDEKytg+g4ttK55caCDugrIjlIajIcJ5IVd7CSb st2qWFxIhMgFDmyt5fZZV+/OekvciTKY/E6Tr10lar491nBViSUzNAEDbhonLxIeMYnp adSqkNmuUmdJgfLMZN60Qj0nejFnRaaNRjH0l7WAKoyxdbFFsOtGLk0NpuzfXA7Koovh JLf0qElsM2qPP/cmd0B1XI8pZ7NgiMuPOlHRZOkuFuUeJloStZ89Cd/UFSYiE6ZoJGu4 xgCuKMOG/RnewF+yfiCQZLrjIsE+6Uv/yqCKVp+ELORTgwa4R5JZ9yydaer39TTXgdJ0 KjPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771831533; x=1772436333; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hidpuNttSwZHxHCys+Rdwk1AShkIe4ps5Ps0hErcBKQ=; b=JVmteW/0kBHbaeC1CS7BI8qeFNCsfk/LQrMGEMjYIt1v/B96+8J44rrjp0/JeXpJmB pqathmfvjUQtxTLreTyR7uMw1f4bhhm/x/TgTYMoY7RtfdrORZXfOQHAo0tsAcDFG5TH /+RGkO1dZ4sMh1zT+NWWnvM9ilcn870gGWeoxD814epzC6ysf0L1pIqYnwdpeVRaPErs L6PHNnRUB6txwx8QprIHD9HLxF353jxmA0fZW3r37c4snYeeJv75v6pk2FZVBDcitktr hss1LWNB7T8SBaZTytoNuv9S+e0lpYZwjMupFYboNluKuI8dwKf8cxUD8iqmAV38/Geq DGww== X-Forwarded-Encrypted: i=1; AJvYcCWdF3HeMhUaFaopCygpW2/FOHcS2fCc/+JXLe+vanX2gY6OEd/Hakj0GLs2YQk8/qW9DfhNAJ7C87kOkHs=@vger.kernel.org X-Gm-Message-State: AOJu0YzyQS3rsGMPeASz60kRU2Dt1DEnOyofd5I7myyoUsdp/kIRF9MU UHMvoycsNR4wgNi7qd9zRNaqNV0UE69s0kYWYk/8VatcKG8E15vGxjvjGko67BRE0O/3OqoQwt7 s0PK/xe2E/a1gBDC7gGlqYewXIg== X-Received: from pjbjs16.prod.google.com ([2002:a17:90b:1490:b0:32e:ca6a:7ca9]) (user=ackerleytng job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3c43:b0:340:bfcd:6af8 with SMTP id 98e67ed59e1d1-358ae7be0b3mr6177609a91.4.1771831533175; Sun, 22 Feb 2026 23:25:33 -0800 (PST) Date: Mon, 23 Feb 2026 07:25:27 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.53.0.345.g96ddfc5eaa-goog Message-ID: <3d698e6fcf052628629d9bd928fcef5fea049a76.1771831180.git.ackerleytng@google.com> Subject: [RFC PATCH v1 RESEND 1/2] XArray tests: Fix check_split tests to store correctly From: Ackerley Tng To: willy@infradead.org, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: david@kernel.org, michael.roth@amd.com, dev.jain@arm.com, vannapurve@google.com, Ackerley Tng Content-Type: text/plain; charset="UTF-8" __xa_store() does not set up xas->xa_sibs, and when it calls xas_store(), xas_store() stops prematurely and does not update node->nr_values to count all values and siblings. Hence, when working with multi-index XArrays, __xa_store() cannot be used. Fix tests by calling xas_store() directly with xas->xa_sibs correctly set up. Change-Id: I144b96b8724c27ac4a6d53be1e74125bf8d3aebe Signed-off-by: Ackerley Tng --- lib/test_xarray.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/test_xarray.c b/lib/test_xarray.c index 5ca0aefee9aa5..e71e8ff76900b 100644 --- a/lib/test_xarray.c +++ b/lib/test_xarray.c @@ -1846,8 +1846,14 @@ static void check_split_1(struct xarray *xa, unsigned long index, xas_split_alloc(&xas, xa, order, GFP_KERNEL); xas_lock(&xas); xas_split(&xas, xa, order); - for (i = 0; i < (1 << order); i += (1 << new_order)) - __xa_store(xa, index + i, xa_mk_index(index + i), 0); + for (i = 0; i < (1 << order); i += (1 << new_order)) { + xas_set_order(&xas, index + i, new_order); + /* + * Don't worry about -ENOMEM, xas_split_alloc() and + * xas_split() ensures that all nodes are allocated. + */ + xas_store(&xas, xa_mk_index(index + i)); + } xas_unlock(&xas); for (i = 0; i < (1 << order); i++) { @@ -1893,8 +1899,14 @@ static void check_split_2(struct xarray *xa, unsigned long index, xas_unlock(&xas); goto out; } - for (i = 0; i < (1 << order); i += (1 << new_order)) - __xa_store(xa, index + i, xa_mk_index(index + i), 0); + for (i = 0; i < (1 << order); i += (1 << new_order)) { + xas_set_order(&xas, index + i, new_order); + /* + * Don't worry about -ENOMEM, xas_split_alloc() and + * xas_split() ensures that all nodes are allocated. + */ + xas_store(&xas, xa_mk_index(index + i)); + } xas_unlock(&xas); for (i = 0; i < (1 << order); i++) { -- 2.53.0.345.g96ddfc5eaa-goog