2022-12-30 11:54 GMT+09:00, Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>: > On (22/12/28 00:02), Namjae Jeon wrote: > [..] >> @@ -175,6 +175,7 @@ static int ipc_ksmbd_starting_up(void) >> ev->smb2_max_write = global_conf.smb2_max_write; >> ev->smb2_max_trans = global_conf.smb2_max_trans; >> ev->smbd_max_io_size = global_conf.smbd_max_io_size; >> + ev->max_connections = global_conf.max_connections; >> ev->share_fake_fscaps = global_conf.share_fake_fscaps; >> memcpy(ev->sub_auth, global_conf.gen_subauth, sizeof(ev->sub_auth)); >> ev->smb2_max_credits = global_conf.smb2_max_credits; >> diff --git a/tools/config_parser.c b/tools/config_parser.c >> index 2dc6b34..5f36606 100644 >> --- a/tools/config_parser.c >> +++ b/tools/config_parser.c >> @@ -548,6 +548,11 @@ static gboolean global_group_kv(gpointer _k, gpointer >> _v, gpointer user_data) >> return TRUE; >> } >> >> + if (!cp_key_cmp(_k, "max connections")) { >> + global_conf.max_connections = memparse(_v); >> + return TRUE; >> + } >> + > > I'd say that it'll make sense to me if ksmbd will impose a default > limit on the number of connections, which people can overwrite. Yes, > I know that samba doesn't limit by default, but ksmbd is a kernel > module and the price of unlimited resource consumption is higher. > We can't probably easily apply the "samba does it" rule here. What > do you think? > > How about: > - default `max connections`, say, of 512. max possible value, say, 64k? > - `max connections` cannot be zero Make sense. I will update it on v2. Thanks for your review:) >