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
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
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 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
Currently the FC-NVMe driver is leveraging the SCSI FC transport class to
access the remote ports. Which means that all FC-NVMe remote ports will be
visible to the fc transport layer, but due to missing definitions the port
roles will always be 'unknown'. This patch adds the missing definitions to
the fc transport class to that the port roles are correctly displayed.
Signed-off-by: Hannes Reinecke <hare@suse.de>
[ bvanassche: Ported this patch to SCST ]
See also upstream commit a6a6d0589ac4 ("scsi: scsi_transport_fc: nvme:
display FC-NVMe port roles") # v5.2-rc1.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8414 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that the following error is reported when building SCST against
a Linux kernel older than v4.18 combined with MOFED >= 4.5:
scst/include/backport.h:910:21: error: redefinition of 'kvcalloc'
static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
^
In file included from ./include/linux/highmem.h:8:0,
from ./include/linux/bio.h:21,
from ./scst/include/backport.h:24,
from ./scst/include/scst_debug.h:42,
from isert-scst/isert_dbg.h:29,
from isert-scst/iser_global.c:40:
/usr/src/ofa_kernel/default/include/linux/mm.h:78:21: note: previous definition of 'kvcalloc' was here
static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
^
Signed-off-by: Sergey Gorenko <sergeygo@mellanox.com>
[bvanassche: renamed MOFED_*_VERSION INTO MOFED_*]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8398 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Move the build_mode file from the top level into the scst directory. Write
build mode defines into scst/include/build_mode.h and include that file
directly or indirectly in all source files that depend on these #defines.
This approach has the advantage that "make clean" does no longer has to
be run when switching between build modes because the kernel build system
recognizes build_mode.h as a dependency and triggers a rebuild of all
source files that directly or indirectly include the build_mode.h header
file.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8347 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Due to the previous patch this backport is no longer needed. Note: the
wait_event_lock_irq_timeout() needs more work.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8238 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Although the SLAB allocator exports the kmalloc_track_caller() function,
the SLUB allocator does not. Hence use kmalloc() instead of
kmalloc_track_caller().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8163 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch makes it safe to call mempool_destroy(NULL) for kernel versions
before v4.3.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8150 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch makes it safe to call kmem_cache_destroy(NULL) on kernel v4.2
and before.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8149 d57e44dd-8a1f-0410-8b47-8ef2f437770f