From nobody Sat Feb 7 21:05:00 2026 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 78E142853EE for ; Thu, 18 Dec 2025 11:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766056950; cv=none; b=P5Z6bwssknkWBrN/xGI69mRGkrQnjA7vBjrzv//pWCt4GaSYHl6VrLuWVj3pO2PJZm5trHEjdjCfTLH8BNTL53OVOIn77n8a6urtYrqN5wYdUNXm9Hh8F3nUF8kDw30XooA9Tvmxc6MMv/koMJ+GhzsD171ZFgchKbgRtzTbO2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766056950; c=relaxed/simple; bh=8s9ID86ToNKjPfHy7R6EK7xgo44vyRv1nviw21SGEtE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lLUXBHgjS79pu5CvXkWm1w71gscVsZUvWOxadv5vZ7Whzu9EGkdyHmKZXJJNi1fVbnKFKkFYz0KL6q1nSB2S7XwKi6VmwfCdAmKvsxh8qsReYVtp9LQF+naFT0IA6oa5gDnGwdF4xB2Lpu0TmJ+6ZF+R/VNM/JCwGWeBuAppkY4= 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=jRZo0Wa4; arc=none smtp.client-ip=91.218.175.172 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="jRZo0Wa4" 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=1766056931; 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=etjK20rY/G4b3a+WqeAgjWrAs++AyA4NRNLHPZ9xUo4=; b=jRZo0Wa4SkB6M9Hz5fAOxYaDNBdJiVhnEeZ2EYk4eba6Q/o+q5VII0gtGOjKqnMDTF7DTb 32EJoJX1KCwhx2ioCjSwHy2lcRXi4YTRV1QPAk1HnuX9SHkwXPmCPhQS6RshR7PzmauRiz DpXK+/d82Kh3wbMaHCEFq9c0jp7xVlU= 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] fs: Replace simple_strtoul with kstrtoul in set_ihash_entries Date: Thu, 18 Dec 2025 12:21:45 +0100 Message-ID: <20251218112144.225301-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 'ihash_entries=3D' boot parameter. Check the return value of kstrtoul() and reject invalid values. This adds error handling while preserving behavior for existing valid values, and removes use of the deprecated simple_strtoul() helper. Signed-off-by: Thorsten Blum Reviewed-by: Jan Kara --- fs/inode.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 521383223d8a..a6df537eb856 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2531,10 +2531,7 @@ static void __wait_on_freeing_inode(struct inode *in= ode, bool is_inode_hash_lock static __initdata unsigned long ihash_entries; static int __init set_ihash_entries(char *str) { - if (!str) - return 0; - ihash_entries =3D simple_strtoul(str, &str, 0); - return 1; + return kstrtoul(str, 0, &ihash_entries) =3D=3D 0; } __setup("ihash_entries=3D", set_ihash_entries); =20 --=20 Thorsten Blum GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4