From nobody Thu Dec 18 23:21:40 2025 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (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 1140C28030E for ; Tue, 16 Dec 2025 14:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765896790; cv=none; b=gpuHXhzJWqLxLDhFQdEQEoYPtD0abpyh6ya8oTe9iMAhQRzg2lqIs/OVYVrRB/duDCVhRKmoMTIxpIIiO2Qai6Gf5OZ1Orj87OXXbJUuqogHpYyYau+5V6OQdx3MpV5UIDQbe9Dta/LoqtOAcn3ncQQN1uWSx9wX+6v6jgWRiDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765896790; c=relaxed/simple; bh=dqD3qZSjcbSnh5gCbahmUSEok9esyhLdBnatHULtqKI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lPbFvgdSVOgYem1+7+3kkzInPi6BvMh/o8VlU1McvIgELVSwGN/rbFWCqBZWzSanZO/orcMKTIUSCDB5kDhPeBNyMM5LccxTCjJlVo7kZRarbA/xqXuVOIulcqYpiTX/zhV2g+U7TmCUokOV5SPINmVEkC3yC9s4Jck+JH7hwBw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=f98E1pah; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="f98E1pah" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1765896775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+xfxZPHc4yJJ1NHFfvbKujleBGkMgd2FNdpQr/zDwwM=; b=f98E1pahqTI6HD+oH0cUYeOl8AWFJaSKCuMK5TJbAr3+ufUC04rb5L2A0NR/cEyYeYLwNy gdlDGXmlByugy/RRYo2NbChHoY9nKnkYX/aiEvnI6AWFtFvmvnarz6u8ArVxnE8B0mptfg 1OATkHsoVBd/G83By78pzhCKrhzq0eY= From: Thorsten Blum To: Alexander Viro , Christian Brauner , Jan Kara Cc: Thorsten Blum , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dcache: Replace simple_strtoul with kstrtoul in set_dhash_entries Date: Tue, 16 Dec 2025 15:52:37 +0100 Message-ID: <20251216145236.44520-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Replace simple_strtoul() with the recommended kstrtoul() for parsing the 'dhash_entries=3D' boot parameter. Check the return value of kstrtoul() and reject invalid values. This adds error handling while preserving behavior for existing values, and removes use of the deprecated simple_strtoul() helper. Signed-off-by: Thorsten Blum Reviewed-by: Jan Kara --- fs/dcache.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index dc2fff4811d1..ec275f4fd81c 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -3227,10 +3227,7 @@ EXPORT_SYMBOL(d_parent_ino); static __initdata unsigned long dhash_entries; static int __init set_dhash_entries(char *str) { - if (!str) - return 0; - dhash_entries =3D simple_strtoul(str, &str, 0); - return 1; + return kstrtoul(str, 0, &dhash_entries) =3D=3D 0; } __setup("dhash_entries=3D", set_dhash_entries); =20 --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4