svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk
........
r5602 | vlnb | 2014-06-13 16:57:26 -0700 (Fri, 13 Jun 2014) | 8 lines
scst_pr_read_reservation(): Initialize returned buffer
Avoid that this function returns an uninitialized buffer to the
initiator if buffer_size < 8. Detected by Coverity.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5604 d57e44dd-8a1f-0410-8b47-8ef2f437770f
After SCST_FLAG_SUSPENDED has been cleared it is essential that
scst_do_job_init() reexamines scst_init_cmd_list to avoid that
commands get stuck in the command init list. This patch fixes the
following race condition that can occur if SCST_FLAG_SUSPENDED
has been set and if scst_init_cmd_list is not empty:
* scst_do_job_init() returns to scst_init_thread() and leaves the
commands that were on the init list on that list.
* scst_init_thread() invokes test_init_cmd_list().
* test_init_cmd_list() returns false because SCST_FLAG_SUSPENDED
has been set.
* scst_resume_activity() clears SCST_FLAG_SUSPENDED and invokes
wake_up_all(&scst_init_cmd_list_waitQ). However, since
scst_init_thread() has not yet added the init thread back to
scst_init_cmd_list_waitQ this wake_up_all() call doesn't do
anything.
* scst_init_thread() adds the init thread to scst_init_cmd_list_waitQ
and unlocks scst_init_lock.
Additionally, remove an unneeded smp_mb__after_clear_bit() call.
wake_up_all() guarantees that if it wakes up a thread that that
thread sees all store operations that were performed by the thread
that invoked wake_up_all() and that preceeded the wake_up_all()
invocation.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5524 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The possible return values of scst_init_cmd() are -1, 0 and 1. Mention
this in the comment header above that function.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5523 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Assign one major number per thread pool instead of as many major
numbers as there are threads in a thread pool. Do not increment
'major' if thread pool allocation fails. Micro-optimize
iscsi_threads_pool_get() by eliminating the assignment to 'fn'
and the write via snprintf() into name[].
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that checkpatch reports the following:
WARNING: do {} while (0) macros should not be semicolon terminated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5517 d57e44dd-8a1f-0410-8b47-8ef2f437770f
According to T10, multibyte opcode commands with not supported service
actions must be refused with INVALID FIELD IN CDB instead of INVALID
OPCODE
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5513 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Introduce the vdisk_bio_alloc(), vdisk_bio_set_failfast() and
vdisk_bio_set_hoq() helper functions. This patch does not change any
functionality.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5511 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Make the path of the file in which persistent reservation information
is stored configurable via sysfs.
Signed-off-by: Bart Van Assche <bvanassche@acm.org> with some improvements and fixes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5510 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Move the definition of scst_get_opcode_name() up such that it occurs
outside #ifndef CONFIG_SCST_PROC / #endif. See also r5491.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5505 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The default value of the 'preferred' attribute is 0 (disabled). Hence
it is only necessary that scstadmin saves the value of that attribute
if it is not zero.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5502 d57e44dd-8a1f-0410-8b47-8ef2f437770f