sg: fix sparse __user annotation warning
Subsystems (2)
PATCH 1/2 sg: fix sparse __user annotation warning
blk_trace_setup takes a __user pointer, so use the local void __user * pointer instead of casting the argument to char * for it in the sg ioctl handler.
Signed-off-by Christoph Hellwig <[email protected]>
--- drivers/scsi/sg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/sg.c +1 -1
@@ -1138,7 +1138,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) sdp->disk->disk_name,MKDEV (SCSI_GENERIC_MAJOR , sdp->index),NULL , - (char *)arg); + p);case BLKTRACESTART :return blk_trace_startstop (sdp->device->request_queue,1 );case BLKTRACESTOP :
Signature · 1 line
1.9.1
PATCH 2/2 scsi: add a CONFIG_SCSI_MQ_DEFAULT option
Add a Kconfig option to enable the blk-mq path for SCSI by default to ease testing and deployment in setups that know they benefit from blk-mq.
Signed-off-by Christoph Hellwig <[email protected]>
--- drivers/scsi/Kconfig | 11 +++++++++++ drivers/scsi/scsi.c | 4 ++++ 2 files changed, 15 insertions(+)
drivers/scsi/Kconfig +11 -0
@@ -45,6 +45,17 @@ config SCSI_NETLINK default n select NET +config SCSI_MQ_DEFAULT + bool "SCSI: use blk-mq I/O path by default" + depends on SCSI + ---help--- + This option enables the new blk-mq based I/O path for SCSI + devices by default. With the option the scsi_mod.use_blk_mq + module/boot option defaults to Y, without it to N, but it can + still be overriden either way. + + If unsure say N. + config SCSI_PROC_FS bool "legacy /proc/scsi/ support" depends on SCSI && PROC_FS
drivers/scsi/scsi.c +4 -0
@@ -1367,7 +1367,11 @@ MODULE_LICENSE("GPL");module_param (scsi_logging_level, int,S_IRUGO |S_IWUSR );MODULE_PARM_DESC (scsi_logging_level,"a bit mask of logging levels" ); +#ifdef CONFIG_SCSI_MQ_DEFAULT +bool scsi_use_blk_mq = true; +#else bool scsi_use_blk_mq = false; +#endif module_param_named (use_blk_mq, scsi_use_blk_mq, bool,S_IWUSR |S_IRUGO );static int __init init_scsi (void )
Signature · 1 line
1.9.1
Quoted 5 lines · Christoph Hellwig
blk_trace_setuptakes a__userpointer, so use the local void__user* pointer instead of casting the argument to char * for it in the sg ioctl handler.Signed-off-by Christoph Hellwig <[email protected]>
Acked-by Douglas Gilbert <[email protected]>
Quoted 18 lines
--- drivers/scsi/sg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/sg.c +1
-1@@ -1138,7 +1138,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg) sdp->disk->disk_name,MKDEV (SCSI_GENERIC_MAJOR , sdp->index),NULL , - (char *)arg); + p);case BLKTRACESTART :return blk_trace_startstop (sdp->device->request_queue,1 );case BLKTRACESTOP :