mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
smb/server: warn if ksmbd_proc_create() fails
Print a warning if the sessions procfs entry cannot be created. 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
79decd88dd
commit
9a74739026
|
|
@ -787,7 +787,8 @@ int ksmbd_conn_transport_init(void)
|
|||
}
|
||||
out:
|
||||
mutex_unlock(&init_lock);
|
||||
create_proc_clients();
|
||||
if (create_proc_clients())
|
||||
pr_warn("Unable to create clients procfs entry\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -204,6 +204,8 @@ static int create_proc_session(struct ksmbd_session *sess)
|
|||
snprintf(name, sizeof(name), "sessions/%llu", sess->id);
|
||||
sess->proc_entry = ksmbd_proc_create(name,
|
||||
show_proc_session, sess);
|
||||
if (!sess->proc_entry)
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -729,7 +731,8 @@ static struct ksmbd_session *__session_create(int protocol)
|
|||
hash_add(sessions_table, &sess->hlist, sess->id);
|
||||
up_write(&sessions_table_lock);
|
||||
|
||||
create_proc_session(sess);
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -663,8 +663,12 @@ static int __init ksmbd_server_init(void)
|
|||
ret = ksmbd_proc_init();
|
||||
if (ret)
|
||||
goto err_unregister;
|
||||
create_proc_sessions();
|
||||
create_proc_shares();
|
||||
|
||||
if (create_proc_sessions())
|
||||
pr_warn("Unable to create sessions procfs entry\n");
|
||||
|
||||
if (create_proc_shares())
|
||||
pr_warn("Unable to create shares procfs entry\n");
|
||||
|
||||
ksmbd_server_tcp_callbacks_init();
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,8 @@ static int proc_show_files(struct seq_file *m, void *v)
|
|||
|
||||
static int create_proc_files(void)
|
||||
{
|
||||
ksmbd_proc_create("files", proc_show_files, NULL);
|
||||
if (!ksmbd_proc_create("files", proc_show_files, NULL))
|
||||
return -ENOMEM;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
|
@ -1828,7 +1829,8 @@ void ksmbd_close_session_fds(struct ksmbd_work *work)
|
|||
|
||||
int ksmbd_init_global_file_table(void)
|
||||
{
|
||||
create_proc_files();
|
||||
if (create_proc_files())
|
||||
pr_warn("Unable to create files procfs entry\n");
|
||||
return ksmbd_init_file_table(&global_ft);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user