opnsense-src/sys
Andriy Gapon 20e9cab5fa iscsi: do not hold the global lock while tearing down a session
It should be sufficient to hold the lock just for removing the session
from the session list.  Everything else should be covered by the session
specific lock.

On top of that, at present we can get a deadlock caused by waiting on
the CAM SIM reference count while holding the global lock.  A specific
scenario involving ZFS is this:
- concurrent termination of two sessions, S1 and S2
- session S1 completed all I/Os and sleeps in CAM waiting for device
  close by ZFS;
- session S2 is also dead now, but can not forcefully complete
  outstanding requests by calling iscsi_session_cleanup() from
  iscsi_maintenance_thread_terminate(), since it can't get the same
  global sc_lock;
- as soon as there are unfinished requests, ZFS can not do
  spa_config_enter() as writer, and so can not close the device for
  session S1;
- deadlock.

Reported by:	Ben RUBSON <ben.rubson@gmail.com>
Tested by:	Ben RUBSON <ben.rubson@gmail.com>
Reviewed by:	mav, trasz
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D12652
2017-10-17 15:39:38 +00:00
..
amd64 Fix the pv_chunks pc_lru tailq handling in reclaim_pv_chunk(). 2017-10-16 15:16:24 +00:00
arm Save VFP state in getcontext(3) on ARM. 2017-10-16 12:53:54 +00:00
arm64 Support the EFI Runtime Services on arm64. As with amd64 we use the 1:1 2017-10-10 13:05:26 +00:00
boot Explicitly inlcude SYSDIR in the include path -- need machine path too? 2017-10-16 03:59:58 +00:00
bsm
cam Zero out the ccb's alloated on the stack for the dump routines to more 2017-10-15 23:54:04 +00:00
cddl illumos mutex_init: use SX_NEW instead of bzero 2017-10-09 07:44:09 +00:00
compat Add information needed by Linux libdrm 2.4.74 (shipped with CentOS 7.4). 2017-10-15 19:28:14 +00:00
conf Support the EFI Runtime Services on arm64. As with amd64 we use the 1:1 2017-10-10 13:05:26 +00:00
contrib Merge ACPICA 20170929 (take 2). 2017-10-10 19:33:24 +00:00
crypto aesni(4): CRYPTO_AES_NIST_GCM_16 mandates MAC 2017-10-04 21:15:45 +00:00
ddb Rename mkdumpheader() and group EKCD functions in kern_shutdown.c. 2017-08-18 04:04:09 +00:00
dev iscsi: do not hold the global lock while tearing down a session 2017-10-17 15:39:38 +00:00
fs Use taskqueue(9) to do writes/commits to mirrored DSs concurrently. 2017-10-16 23:28:12 +00:00
gdb gdb kernel server: fixup Search:memory style 2017-10-17 01:12:17 +00:00
geom Display rotation rate and TRIM/UNMAP support in diskinfo(8) 2017-10-04 15:09:49 +00:00
gnu Update DTS files from Linux 4.12 2017-07-09 13:53:32 +00:00
i386 Change i386_get_ldt() to return 'EOF' when the requested range of 2017-10-09 16:19:26 +00:00
isa Use better hard-coded defaults for the cursor shape, and remove nearby 2017-08-19 19:33:16 +00:00
kern mbuf(9): unbreak m_fragment() 2017-10-16 21:46:11 +00:00
kgssapi
libkern Continuing efforts to provide hardening of FFS, this change adds a 2017-09-22 12:45:15 +00:00
mips bhnd: Add support for supplying bus I/O callbacks when initializing an EROM 2017-09-27 19:48:34 +00:00
modules Hard link if_igb.ko to if_em.ko. Use a LINK directive to ensure that 2017-10-10 19:14:40 +00:00
net ifnet(9): split ifc_alloc_unit() (should simplify code flow) 2017-10-16 21:21:31 +00:00
net80211 [net80211] don't try to follow a NULL rxs pointer down the sink. 2017-10-13 06:49:07 +00:00
netgraph Correction after r323873: #include <sys/lock.h> in addition to <sys/rmlock.h> 2017-09-28 11:26:37 +00:00
netinet Fix the handling of parital and too short chunks. 2017-10-15 19:33:30 +00:00
netinet6 Hide struct socket and struct unpcb from the userland. 2017-10-02 23:29:56 +00:00
netipsec opencrypto: Loosen restriction on HMAC key sizes 2017-09-26 16:18:10 +00:00
netpfil Fix regression in handling O_FORWARD_IP opcode after r279948. 2017-10-13 11:11:53 +00:00
netsmb netsmb: Fix buggy/racy smb_strdupin() 2017-09-29 15:53:26 +00:00
nfs Improve FHA locality control for NFS read/write requests. 2017-07-31 15:23:19 +00:00
nfsclient
nfsserver
nlm
ofed Make sure the IPv6 scope ID gets zeroed inside the GID. Else searching for a 2017-10-10 12:36:41 +00:00
opencrypto crypto(9): Print flags in more useful hex 2017-10-11 20:04:30 +00:00
powerpc PPC: increase MAX_PICS to 32 2017-10-02 06:05:19 +00:00
riscv Sync with amd64/arm/arm64/i386/mips pmap change r288256: 2017-09-20 04:19:49 +00:00
rpc
security Sprinkle __read_frequently on few obvious places. 2017-09-06 20:33:33 +00:00
sparc64 Don't use a non-zero argument for __builtin_frame_address 2017-10-11 03:50:44 +00:00
sys Fix wrong v_free_count annotation - (f) instead of (a) 2017-10-14 04:27:58 +00:00
teken Fix syscons escape sequence for setting the local cursor type. This sequence 2017-08-18 15:40:40 +00:00
tests
tools
ufs Don't defer wakeup()s for completed journal workitems. 2017-09-26 23:24:15 +00:00
vm Reduce traffic on vm_cnt.v_free_count 2017-10-13 21:54:34 +00:00
x86 x86: Decode AMD "Extended Feature Extensions ID EBX" bits 2017-09-20 18:30:37 +00:00
xdr
xen
Makefile