From a9dcdfadeee373ac44ae26d821844ecb3ceaf32d Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Sat, 29 Apr 2017 00:58:55 +0000 Subject: [PATCH 1/2] scst: create proc/scst_threads with mode S_IRUGO, not 0 Signed-off-by: David Butterfield git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7154 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 50ced4c48..4721815ad 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -176,7 +176,7 @@ static unsigned int scst_max_cmd_mem; unsigned int scst_max_dev_cmd_mem; int scst_forcibly_close_sessions; -module_param_named(scst_threads, scst_threads, int, 0); +module_param_named(scst_threads, scst_threads, int, S_IRUGO); MODULE_PARM_DESC(scst_threads, "SCSI target threads count"); module_param_named(scst_max_cmd_mem, scst_max_cmd_mem, int, S_IRUGO); From 128d2b20a80d1bff20de7fc53f80c2ecf999f737 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Sat, 29 Apr 2017 01:00:59 +0000 Subject: [PATCH 2/2] scst: add mutex_lock/unlock around scst_alloc_add_acg() The CONFIG_SCST_PROC build was calling scst_alloc_add_acg() without holding the scst_mutex. Signed-off-by: David Butterfield git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7155 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 4721815ad..8d672b79b 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -2703,7 +2703,9 @@ static int __init init_scst(void) goto out_sysfs_cleanup; #ifdef CONFIG_SCST_PROC + mutex_lock(&scst_mutex); res = scst_alloc_add_acg(NULL, SCST_DEFAULT_ACG_NAME, false, &scst_default_acg); + mutex_unlock(&scst_mutex); if (res != 0) goto out_destroy_sgv_pool; #endif