Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH] mount: remove redundant panic() in mnt_init()
@ 2026-07-20 11:23 Hamza Mahfooz
  2026-07-20 11:51 ` Jori Koolstra
  0 siblings, 1 reply; 2+ messages in thread
From: Hamza Mahfooz @ 2026-07-20 11:23 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Alexander Viro, Christian Brauner, Jan Kara, linux-kernel,
	Hamza Mahfooz

Since at least as far back as commit 0818bf27c05b ("resizable
namespace.c hashes"), we call alloc_large_system_hash() in
mnt_init() which already panics if the table is NULL.

Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
---
 fs/namespace.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index fe919abd2f01..43de01ce023e 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -6248,9 +6248,6 @@ void __init mnt_init(void)
 				HASH_ZERO,
 				&mp_hash_shift, &mp_hash_mask, 0, 0);
 
-	if (!mount_hashtable || !mountpoint_hashtable)
-		panic("Failed to allocate mount hash table\n");
-
 	kernfs_init();
 
 	err = sysfs_init();
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mount: remove redundant panic() in mnt_init()
  2026-07-20 11:23 [PATCH] mount: remove redundant panic() in mnt_init() Hamza Mahfooz
@ 2026-07-20 11:51 ` Jori Koolstra
  0 siblings, 0 replies; 2+ messages in thread
From: Jori Koolstra @ 2026-07-20 11:51 UTC (permalink / raw)
  To: Hamza Mahfooz
  Cc: linux-fsdevel, Alexander Viro, Christian Brauner, Jan Kara,
	linux-kernel

On Mon, Jul 20, 2026 at 07:23:31AM -0400, Hamza Mahfooz wrote:
> Since at least as far back as commit 0818bf27c05b ("resizable
> namespace.c hashes"), we call alloc_large_system_hash() in
> mnt_init() which already panics if the table is NULL.
> 
> Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
> ---
>  fs/namespace.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/fs/namespace.c b/fs/namespace.c
> index fe919abd2f01..43de01ce023e 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -6248,9 +6248,6 @@ void __init mnt_init(void)
>  				HASH_ZERO,
>  				&mp_hash_shift, &mp_hash_mask, 0, 0);
>  
> -	if (!mount_hashtable || !mountpoint_hashtable)
> -		panic("Failed to allocate mount hash table\n");
> -
>  	kernfs_init();
>  
>  	err = sysfs_init();
> -- 
> 2.55.0
> 

There isn't a reasonable way to return from this, and I see the other
uses of alloc_large_system_hash() also don't check for NULL, so this
is an OK clean-up.

Reviewed-by: Jori Koolstra <jkoolstra@xs4all.nl>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-20 11:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 11:23 [PATCH] mount: remove redundant panic() in mnt_init() Hamza Mahfooz
2026-07-20 11:51 ` Jori Koolstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox