From nobody Wed Feb 11 06:30:45 2026 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (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 0DB842F3C26 for ; Sat, 31 Jan 2026 00:15:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769818549; cv=none; b=ZQxEU3Nvp1s7GMbNhoNEugb7wLOzLS6j8BhkPS8ThR/PnUXcupaxaYeki/WxQdAHwqob1A5ys6bVLbSNw4ntBcVrdJ6gwzmMx2Lb+3gRKBvV3tdvDMMVXnB+GvaRd09byofLklMISedwK25tHxTn8A67LOQ6d8JEl+8gEkbDKSs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769818549; c=relaxed/simple; bh=yh5kAh18cBogYAATy2I7lcJQCwjv7XVTR/hdtC7DjdU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=oqlp6IEa10LxZqjEt0sqGJO/pNHNj09SGAbVXiuMb5Yrbc5KaTVaE+DChLcwHxOdjGJcXfdpowkz7KeQkJ3mawA1zNU1UbI3iJr7qgGCKt4k1rgcB4iSAHIA4SRBG2qqzLABxJcKHWdbIZ+bYOvv1c+MCGE16vAF/i9Qo0gxIEY= 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=u1zPPWW9; arc=none smtp.client-ip=209.85.215.201 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="u1zPPWW9" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-c63597a63a6so1616775a12.3 for ; Fri, 30 Jan 2026 16:15:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769818547; x=1770423347; 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=JBT3eXirMhITfHBhMfm7jmk9GgDGwvmhXO+L7+fYBQE=; b=u1zPPWW9tboKsJs7a6EIfO7xX69K9uslVUqrd1quQZAq0pDUzzryhTqV7iL1FVOSUi 9sgrSUjOIHDdcw2DKRlWjcNdV4qxWjbhR4Ourf2OGRMknYhb9zyUoIfdgq5WMlWjhh20 MhU4NajepoNh05vUvp5tnWOSVKRX1Uks/8PBMNKzdPcGnppy37cikocuazJKU7179urR yfcBaPHWlY+0khv05igQul1lkmpFA+ec2drJPkXqFHADda1ml73sKjBn0Bx19m9vulXN IvxTugppoN6Qyek0wYqFX+89QIZzEWsqdtSrFU+tj++vSmJ3z5VNh0OJJXlaj8ZOFCS3 UiAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769818547; x=1770423347; 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=JBT3eXirMhITfHBhMfm7jmk9GgDGwvmhXO+L7+fYBQE=; b=JxyGQshFMZL3PgGjrtYPhnV+SwpXmhP3aCK41GX+Sec8Hxbm8/IKsEXA6ikzDpK1oS A0wbSN7ngQYonxKc6ov03WTR8/qQWcTEBeJl80xdWjK4KEwKKGDdQ/vSbKmazOy6M8gT Quv8xG+JuPytx8ROIuXS2ZGkCvJVtTASjOH/LxU+OnR1tx36p+moGV8WPK/oPWl7fJbU LH9Icq6vAh5HH21muRzyYW7uGrq+eTcuYukJRHQw7pp18vwPR0XazQsOkXaJ6p3VPPY5 DeO4X8d5MwVW+wSR4tIQAOzjXSk+d5teFrXw02noSrHgemhWDEEnpKvVApklw5GE/G1L /WFQ== X-Forwarded-Encrypted: i=1; AJvYcCVc7DN9WeglYUhZ2OOz/5SkHx83Uu9nbAjF8NV56e7QwKhXbUQOd+vGE9x7PPzo/Jvlq+7xxs4vgGbjMj8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+ym+iLM/pK1CIVZG+Uq+AGHn7Uox1KwgELE3jvAntMXpgsw0r L2Qywn1KJ8FctgPunQfU9m5S/njsywv+nNwmP1zcq60oeB7n89GZ4s7xhO+HIHZdg+vAm0Kslfp zle4jdzwEpjNjXCBPc0DShLMo+Q== X-Received: from plgx11.prod.google.com ([2002:a17:902:ec8b:b0:2a8:7205:a979]) (user=ackerleytng job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:244b:b0:38d:f745:4d43 with SMTP id adf61e73a8af0-392e01329b9mr4952220637.57.1769818547428; Fri, 30 Jan 2026 16:15:47 -0800 (PST) Date: Fri, 30 Jan 2026 16:15:37 -0800 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.rc1.225.gd81095ad13-goog Message-ID: <720e32d8e185d5c82659bbdede05e87b3318c413.1769818406.git.ackerleytng@google.com> Subject: [RFC PATCH v1 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@redhat.com, michael.roth@amd.com, dev.jain@arm.com, vannapurve@google.com, Ackerley Tng Content-Transfer-Encoding: quoted-printable 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. 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 5ca0aefee9aa..e71e8ff76900 100644 --- a/lib/test_xarray.c +++ b/lib/test_xarray.c @@ -1846,8 +1846,14 @@ static void check_split_1(struct xarray *xa, unsigne= d long index, xas_split_alloc(&xas, xa, order, GFP_KERNEL); xas_lock(&xas); xas_split(&xas, xa, order); - for (i =3D 0; i < (1 << order); i +=3D (1 << new_order)) - __xa_store(xa, index + i, xa_mk_index(index + i), 0); + for (i =3D 0; i < (1 << order); i +=3D (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); =20 for (i =3D 0; i < (1 << order); i++) { @@ -1893,8 +1899,14 @@ static void check_split_2(struct xarray *xa, unsigne= d long index, xas_unlock(&xas); goto out; } - for (i =3D 0; i < (1 << order); i +=3D (1 << new_order)) - __xa_store(xa, index + i, xa_mk_index(index + i), 0); + for (i =3D 0; i < (1 << order); i +=3D (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); =20 for (i =3D 0; i < (1 << order); i++) { --=20 2.53.0.rc1.225.gd81095ad13-goog