Commit Graph

4804 Commits

Author SHA1 Message Date
Bart Van Assche
00bf2ee083 qla2x00t: Fix a potential buffer overflow
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-07 15:55:22 +02:00
Bart Van Assche
3213130f66 qla2x00t: Fix a potential buffer overflow
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-07 15:55:22 +02:00
Bart Van Assche
823e4dd887 qla2x00t: Change type of first argument of qla24xx_prep_ct_fm_req()
This makes it easier for Coverity to analyze this code.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-07 15:55:22 +02:00
Bart Van Assche
2ef13131b4 iscsiadm: Fix a resource leak in an error path
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-07 15:20:44 +02:00
Bart Van Assche
fbbea79704 iscsi-scstd: Annotate a fall-through for Coverity
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-07 15:20:44 +02:00
Bart Van Assche
035b12c8a7 Merge branch 'svn-trunk' 2015-05-07 11:14:57 +02:00
Bart Van Assche
f4d718309d iscsi-scstd: Constify several function arguments
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-07 11:13:51 +02:00
Bart Van Assche
a92e509177 iscsi-scstd: Suppress a compiler warning
Avoid that gcc reports the following compiler warning:

message.c:197:44: warning: 'rsp_data_sz' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-07 11:13:50 +02:00
Bart Van Assche
9915d5a016 iscsi-scstd: Allow the compiler to inline functions
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-07 11:10:53 +02:00
Vladislav Bolkhovitin
c6c52f4a71 Fix FAILFAST for pass-through requests
It seems that REQ_QUIET and REQ_FAILFAST flags were confused. We want
both printed information in the logs about backend devices IO faulires
and fail fast pass-through requests without extra retries. Setting
rq->retries along is not sufficient, because in the kernel code retries
and the FAILFAST bitfields control behavior of different kernel pieces,
so they need to be used together. For instance, blk_noretry_request()
has no idea about rq->retries.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6204 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-05-07 02:21:35 +00:00
Bart Van Assche
e1a1667e51 fileio: Fix a potential buffer overflow
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
60decfb5b8 SCST RPMs: Build in release mode
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
afca3efc45 qla2x00t: Help Coverity with analyzing ct_sns_pkt initialization
This patch does not change any functionality. See also the upstream
patch "qla2xxx: Help Coverity with analyzing ct_sns_pkt initialization".

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
43cbdda736 qla2x00t: Fix a potential buffer overflow
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
bd20e1fcf7 ib_srpt, make clean: Remove all temporary files
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
fbefda3445 iscsiadm: Fix a resource leak
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
d479592413 iscsiadm: Fix strerror() argument
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
e7905028e8 iscsiadm: Fix a (harmless) incorrect sizeof() expression
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
d37f120a01 iscsiadm: Fix a file descriptor leak in an error path
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
484ad85aca iscsi-scstd: Fix a resource leak in an error path
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
94af8a1082 iscsi-scstd: Fix a file descriptor leak
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
3eddafe90c iscsi-scstd: Avoid that Coverity complains about a use-after-free
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
d681f8e287 iscsi-scstd: Annotate fall-throughs for Coverity
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
ec8f308851 iscsi-scstd: Move two local variables to suppress a Coverity complaint
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
40c4078e97 iscsi-scstd: Fix a file descriptor leak in an error path
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
9da649131f iscsi-scstd: Fix a dereference-before-null-check
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
1fc64916e5 iscsi-scstd: Fix a memory leak in the iSNS code
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
39f46daa44 iscsi-scstd: Rearrange driver major number lookup code
Introduce a function for looking up the driver major number.
This patch does not change any functionality but makes the source
code easier to read and also makes it easier for Coverity to
analyze this code.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
ab78e6ae61 iscsi-scstd: Improve create_and_open_dev() robustness
Reset 'devn' if the sscanf() return value is lower than two.
Based on a Coverity report.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
189e3b9e7e iscsi-scstd: Fix a dereference-before-null-check
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
ce09b1bb21 iscsi-scst, isert: Add address length check in isert_listen_ioctl()
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
231218932b iscsi-scst: Tell Coverity when scst_aen is set
This suppresses a Coverity complaint.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2015-05-06 14:57:14 +02:00
Bart Van Assche
f54553c148 iscsi-scst: Annotate fall-through cases for Coverity
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
7d3005fdbc iscsi-scst: Fix indentation
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:14 +02:00
Bart Van Assche
ae7819e8f0 scst_debug: Avoid that compiler warnings depend on the build mode
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:13 +02:00
Bart Van Assche
eac3a61c3c scst_tg: Introduce scst_dg_mutex
Make target group locking more fine grained by protecting
target group related data structures via scst_dg_mutex. This
patch fixes a rare deadlock between VPD inquiry and LUN removal.
See also patch "scst: Rework sess_tgt_dev_list locking" (commit
ID 5af7d9277d).

INFO: task scst_uid:12943 blocked for more than 120 seconds.
Call Trace:
[<ffffffff814f9297>] schedule+0x37/0x90
[<ffffffff814fe2fc>] schedule_timeout+0x20c/0x370
[<ffffffff814fa8f7>] wait_for_completion+0xf7/0x130
[<ffffffff81083dc4>] kthread_stop+0x84/0x470
[<ffffffffa04286b8>] scst_del_threads+0xc8/0x250 [scst]
[<ffffffffa0457505>] scst_tgt_dev_stop_threads+0x185/0x1a0 [scst]
[<ffffffffa045e913>] scst_free_tgt_dev+0x103/0x280 [scst]
[<ffffffffa045fb6d>] scst_acg_del_lun+0xcd/0x270 [scst]
[<ffffffffa046fc03>] __scst_process_luns_mgmt_store+0x653/0x6b0 [scst]
[<ffffffffa046fc87>] scst_luns_mgmt_store_work_fn+0x27/0x30 [scst]
[<ffffffffa046b00d>] scst_process_sysfs_works+0xed/0x1f0 [scst]
[<ffffffffa046e4bd>] sysfs_work_thread_fn+0x13d/0x2e0 [scst]
[<ffffffff8108370a>] kthread+0x10a/0x120
[<ffffffff815001a2>] ret_from_fork+0x42/0x70
1 lock held by scst_uid/12943:
  (&scst_mutex){+.+.+.}, at: [<ffffffffa045fb4b>] scst_acg_del_lun+0xab/0x270 [scst]
INFO: task diskf00_0:19854 blocked for more than 120 seconds.
Call Trace:
[<ffffffff814f9297>] schedule+0x37/0x90
[<ffffffff814f9738>] schedule_preempt_disabled+0x18/0x30
[<ffffffff814fb1ce>] mutex_lock_nested+0x16e/0x450
[<ffffffffa0483e6f>] scst_impl_alua_configured+0x1f/0x50 [scst]
[<ffffffffa0504878>] vdisk_inq+0x68/0x2c0 [scst_vdisk]
[<ffffffffa050b05e>] vdisk_exec_inquiry+0x31e/0x440 [scst_vdisk]
[<ffffffffa0502bf6>] vdev_do_job+0x1b6/0x3c0 [scst_vdisk]
[<ffffffffa05030a9>] vdisk_exec+0x29/0x90 [scst_vdisk]
[<ffffffffa0431eb1>] scst_do_real_exec+0xa1/0x450 [scst]
[<ffffffffa043230d>] scst_exec_check_blocking+0xad/0x2b0 [scst]
[<ffffffffa043251e>] scst_exec_check_sn+0xe/0x10 [scst]
[<ffffffffa0439e75>] scst_process_active_cmd+0x3f5/0x7e0 [scst]
[<ffffffffa043b7eb>] scst_do_job_active+0xeb/0x180 [scst]
[<ffffffffa043b9bc>] scst_cmd_thread+0x13c/0x2c0 [scst]
[<ffffffff8108370a>] kthread+0x10a/0x120
[<ffffffff815001a2>] ret_from_fork+0x42/0x70
1 lock held by diskf00_0/19854:
  (&scst_mutex){+.+.+.}, at: [<ffffffffa0483e6f>] scst_impl_alua_configured+0x1f/0x50 [scst]

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:13 +02:00
Bart Van Assche
b71ab710d8 scst_tg: Convert dynamic into static initialization
This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:13 +02:00
Bart Van Assche
947bdc3227 scst_sysfs: Remove dead code
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:13 +02:00
Bart Van Assche
631ad2560b scst_targ: Remove dead code
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 14:57:13 +02:00
Bart Van Assche
af94d2ce4f scst: Fix a race between scst_del_threads() and the sysfs API
kthread_stop() not only stops a thread but also frees the associated
task struct. Avoid that functions that iterate over the thread list
can encounter an invalid task structure pointer. This patch fixes the
following kernel crash:

general protection fault: 0000 [#2] PREEMPT SMP
RIP: 0010:[<ffffffff81080e9c>]  [<ffffffff81080e9c>] __task_pid_nr_ns+0x9c/0x1b0
Call Trace:
[<ffffffffa045ed7d>] task_pid_vnr+0xd/0x10 [scst]
[<ffffffffa0460418>] scst_tgt_dev_thread_pid_show+0x78/0xd0 [scst]
[<ffffffffa045929f>] scst_show+0xf/0x20 [scst]
[<ffffffff81231acb>] sysfs_kf_seq_show+0xab/0x130
[<ffffffff81230176>] kernfs_seq_show+0x26/0x30
[<ffffffff811daf10>] seq_read+0xe0/0x3e0
[<ffffffff81230ab5>] kernfs_fop_read+0x125/0x180
[<ffffffff811b0138>] __vfs_read+0x28/0xe0
[<ffffffff811b07ca>] vfs_read+0x8a/0x140
[<ffffffff811b1669>] SyS_read+0x49/0xb0
[<ffffffff814ffd32>] system_call_fastpath+0x16/0x7a

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 13:56:52 +02:00
Bart Van Assche
38cd0a345d scst, T10-PI: Kernel 2.6.30 build fix
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-06 08:26:15 +02:00
Bart Van Assche
cb823d4d66 Merge branch 'svn-trunk' into master 2015-05-06 08:25:45 +02:00
Vladislav Bolkhovitin
e719f0eca5 ib_srpt: cleanup fixed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6203 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-05-06 02:05:54 +00:00
Vladislav Bolkhovitin
627f79738f Fix proc build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6202 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-05-06 01:02:04 +00:00
Vladislav Bolkhovitin
9b66034f3f T10-PI documentation
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6201 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-05-06 00:49:13 +00:00
Vladislav Bolkhovitin
2a5679df53 T10-PI clarifications
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6200 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-05-06 00:48:42 +00:00
Vladislav Bolkhovitin
e919c5bb20 Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6199 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-05-06 00:47:22 +00:00
Bart Van Assche
9fcfc5ff90 qla2xxx: Declare local symbols 'static'
Additionally, remove unused code. Detected by sparse.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-05 11:46:10 +02:00
Bart Van Assche
7e4d8fb1dd scst_targ: Kernel 2.6.36 build fix
See also patch "scst: Rework sess_tgt_dev_list locking" (commit
ID 5af7d9277d).

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-05 11:46:10 +02:00
Bart Van Assche
168e81c523 scst_targ: Fix a debug statement
See also patch "Merge t10-pi branch back" (commit ID 906f4dfefb).

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-05-05 09:23:03 +02:00