Relogin fails to move forward due to scan_state flag indicating device is
not there. Before relogin process, Session delete process accidently
modified the scan_state flag.
[ commit 8b5292bcfcacf15182a77a973a98d310e76fd58b upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8529 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Reject eh_{abort|device_reset|target_reset} when rport is being torn down
or chip is down.
[ commit 7f4374e67b3046c9628cf0ab93a117704a38e95d upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8528 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Firmware dump captured during LOOP Init error does not yield any
significant information. This patch removes call to trigger firmware dump
collection during Loop Initialization.
[ commit 5e5402c147083786db2238302e25c44b7a7dc5e9 upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8527 d57e44dd-8a1f-0410-8b47-8ef2f437770f
For target mode, the default number of Q-Pairs allowed to use is 2. If the
number of Q-Pairs allocated is lower than the default Q-Pairs, then lower
value should be the set as default.
[ commit 178235f43ea142cf0f07dba67657494fcec21254 upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8526 d57e44dd-8a1f-0410-8b47-8ef2f437770f
If an abort times out, the Abort IOCB completion and Abort timer can race
against each other. This patch provides unique error code for timer path to
allow proper cleanup.
[ commit 0c6df59061b23c7a951836d23977be34e896d3da upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8525 d57e44dd-8a1f-0410-8b47-8ef2f437770f
With debug kernel we see following wanings indicating memory leak.
[28809.523959] WARNING: CPU: 3 PID: 6790 at lib/dma-debug.c:978
dma_debug_device_change+0x166/0x1d0
[28809.523964] pci 0000:0c:00.6: DMA-API: device driver has pending DMA
allocations while released from device [count=5]
[28809.523964] One of leaked entries details: [device
address=0x00000002aefe4000] [size=8208 bytes] [mapped with DMA_BIDIRECTIONAL]
[mapped as coherent]
Fix this by unmapping DMA memory.
[ commit 5d328de64d89400dcf9911125844d8adc0db697f upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8523 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Use vzalloc instead of using vmalloc to allocate memory and then zeroing it
with memset. This simplifies the code.
[ commit 56cc8fae5f7e9f38cb367754c52491ba1645d1bf upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8522 d57e44dd-8a1f-0410-8b47-8ef2f437770f
A null check before dma_pool_destroy is redundant, so remove it. This is
detected by coccinelle.
[ commit 0b3b6fe299c471e44ed8713b7a602882626e693f upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8521 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since r8322 was the result of an incorrect application of an upstream patch,
revert it.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
r8478 was not necessary to fix the reported problem. Additionally, it
introduced a new problem, namely that detach_tgt was not called if the
associated device was deleted after the LUN was deleted and before it
was freed.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8517 d57e44dd-8a1f-0410-8b47-8ef2f437770f
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
A later patch will free tgt_devs after an RCU grace period. Make it
safe to access the target template pointer after an RCU grace period.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8474 d57e44dd-8a1f-0410-8b47-8ef2f437770f