]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ksmbd: increase session and share hash table bits
authorNamjae Jeon <linkinjeon@kernel.org>
Sun, 24 Aug 2025 23:27:12 +0000 (08:27 +0900)
committerSteve French <stfrench@microsoft.com>
Wed, 1 Oct 2025 02:37:55 +0000 (21:37 -0500)
Increases the number of bits for the hash table from 3 to 12.
The thousands of sessions and shares can be connected.
So the current 3-bit size can lead to frequent hash collisions.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/mgmt/share_config.c
fs/smb/server/mgmt/user_session.c

index d3d5f99bdd34edcb318c47afa20f7041c64103a7..c9b1108d6e96d694288d1f20fd423b91f81f6200 100644 (file)
@@ -19,7 +19,7 @@
 #include "../transport_ipc.h"
 #include "../misc.h"
 
-#define SHARE_HASH_BITS                3
+#define SHARE_HASH_BITS                12
 static DEFINE_HASHTABLE(shares_table, SHARE_HASH_BITS);
 static DECLARE_RWSEM(shares_table_lock);
 
index b36d0676dbe584631c053976c367e371ac4279c4..6fa025374f2f3ae89fb39aeb4f42e6557c8290a9 100644 (file)
@@ -18,7 +18,7 @@
 
 static DEFINE_IDA(session_ida);
 
-#define SESSION_HASH_BITS              3
+#define SESSION_HASH_BITS              12
 static DEFINE_HASHTABLE(sessions_table, SESSION_HASH_BITS);
 static DECLARE_RWSEM(sessions_table_lock);