mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
smb/server: update session counter under sessions table lock
KSMBD_COUNTER_SESSIONS tracks sessions published in sessions_table.
Increment it while holding sessions_table_lock so publishing a session and
updating the counter happen together.
Fixes: b38f99c121 ("ksmbd: add procfs interface for runtime monitoring and statistics")
Signed-off-by: Ze Tan <tanze@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
parent
99b25b046e
commit
492b24b5b6
|
|
@ -740,11 +740,11 @@ static struct ksmbd_session *__session_create(int protocol)
|
|||
|
||||
down_write(&sessions_table_lock);
|
||||
hash_add(sessions_table, &sess->hlist, sess->id);
|
||||
ksmbd_counter_inc(KSMBD_COUNTER_SESSIONS);
|
||||
up_write(&sessions_table_lock);
|
||||
|
||||
if (create_proc_session(sess))
|
||||
pr_warn_ratelimited("Unable to create session %llu procfs entry\n", sess->id);
|
||||
ksmbd_counter_inc(KSMBD_COUNTER_SESSIONS);
|
||||
return sess;
|
||||
|
||||
error:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user