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
Bart Van Assche
f835be1355
scst_sysfs: Do not suspend I/O for LUN management
...
The previous patches make it safe to remove a LUN from
sess_tgt_dev_list while I/O is in progress. Hence this patch
that allows LUN management without suspending I/O.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 10:51:09 +02:00
Bart Van Assche
7af292fa68
scst: Introduce scst_acg_repl_lun()
...
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 10:51:09 +02:00
Bart Van Assche
7ac6a64fa8
scst_lib: Move more functionality into scst_del_acg_dev()
...
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 10:50:52 +02:00
Bart Van Assche
691daf7c04
scst_sysfs: Rework __scst_process_luns_mgmt_store()
...
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 10:49:24 +02:00
Bart Van Assche
7d1926f773
scst_lib: Introduce scst_del_tgt_dev()
...
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 10:49:20 +02:00
Bart Van Assche
5af7d9277d
scst: Rework sess_tgt_dev_list locking
...
Protect modifications of sess_tgt_dev_list with the new mutex
tgt_dev_list_mutex. Protect read-only accesses of this list via
RCU. Do no longer lock scst_mutex when invoking any of the
following functions:
* scst_queue_report_luns_changed_UA().
* scst_report_luns_changed_sess().
* scst_lookup_tgt_dev() when invoked outside of command context.
* scst_nexus_loss().
* scst_do_nexus_loss_sess().
* scst_abort_all_nexus_loss_sess().
* scst_do_nexus_loss_tgt().
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 10:49:20 +02:00
Bart Van Assche
d22ba32ea1
scst: Avoid that a high I/O load prevents activity to be suspended
...
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 08:35:06 +02:00
Bart Van Assche
ec5e922002
scst_targ: Add more debug code in scst_unblock_aborted_cmds()
...
Use lockdep to verify that the caller holds scst_mutex if the
scst_mutex_held argument has not been set.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 07:12:54 +02:00
Bart Van Assche
8cf0fcbe86
scst_lib: Fix a use-after-free in an error path
...
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 07:12:37 +02:00
Bart Van Assche
63961f14aa
scst_vdisk: Fix proc build
...
See also "Merge T10-PI branch back" (commit ID 906f4dfefb ).
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-04 07:11:21 +02:00
Bart Van Assche
018df6aeca
dev_handlers: Report invalid block sizes
...
If while attaching a pass-through device the READ CAPACITY command
reports an invalid sector size, log an error message.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-03 20:59:46 +02:00
Bart Van Assche
80ee34c059
scst_vdisk: Remove several superfluous casts
...
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-03 20:59:38 +02:00
Bart Van Assche
4177648d92
isert: Declare a local function static
...
Detected by checkpatch.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-03 20:59:37 +02:00
Bart Van Assche
7abae677f1
iscsi-scst: Surround complex values with parentheses
...
Detected by checkpatch.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-03 20:59:36 +02:00
Bart Van Assche
8108c2c3cb
scst.h: Use tabs for indentation
...
Reported by checkpatch.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-05-03 20:59:17 +02:00