Avoid that deleting a device concurrently with scst_cm_init_inq_finish()
causes command processing to hang.
Reported-by: valera <valer4ik@users.sourceforge.net>
Fixes: 0bb6de9471 ("scst_vdisk: Avoid that LUN refresh triggers a general protection fault" / r7101)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8515 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch makes the implementation of scst_prepare_request_sense() consistent
with the other code that submits internal commands.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8512 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch does not change any functionality but improves source code
readability.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8511 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Some scripts that use the SCST sysfs interface depend on filp_close()
having been called before device deletion via the sysfs interface
finishes. Hence make device deletion again synchronous.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8510 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Merge scst_free_device() and scst_finally_free_device() into a single
function. Increase dev->refcnt when registering a device or virtual
device. Kill and decrease dev->refcnt when unregistering a device or
virtual device. These changes ensure that a scst_free_device() is
only called after all users (commands and tgt_devs) have stopped
accessing the SCST device.
Fixes: 3f2d50b589 ("scst: Do not suspend command processing when deleting a device"; r8067)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8501 d57e44dd-8a1f-0410-8b47-8ef2f437770f
scst_free_tgt_dev() waits until pending I/O commands have finished and hence
can take a while.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8487 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since scst_free_tgt_dev() is called as soon as the tgt_dev refcount
drops to zero and since scst_del_tgt_dev() decrements that reference
count, remove all scst_free_tgt_dev() calls that follow a
scst_del_tgt_dev() call. Set nr_deleted_tgt_devs in scst_acg_add_lun()
to -1 to avoid that all scst_del_tgt_dev() calls try to free the
associated acg_dev.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8478 d57e44dd-8a1f-0410-8b47-8ef2f437770f
A later patch will introduce a delay between deleting and freeing a tgt_dev.
Move the code that decrements dev->not_pr_supporting_tgt_devs_num from the
function that frees a tgt_dev into the function that deletes a tgt_dev such
that the decrement code does not get delayed.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8476 d57e44dd-8a1f-0410-8b47-8ef2f437770f
In kernel v5.3 the ib_destroy_cq() return type has been changed from 'int'
into 'void'.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8475 d57e44dd-8a1f-0410-8b47-8ef2f437770f