]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
scsi: libiscsi: add lock around task lists to fix list corruption regression
authorChris Leech <cleech@redhat.com>
Tue, 28 Feb 2017 00:58:36 +0000 (16:58 -0800)
committerTim Gardner <tim.gardner@canonical.com>
Tue, 28 Mar 2017 20:17:54 +0000 (14:17 -0600)
commit253c9991d76f3ca62ea7b3d2a54fbe2aba37a90e
tree10adfadc687cb73fd60e3433e2e0d44900a84d4e
parent8ee90d6e9ad2589e69bee8f71aeb08081099882c
scsi: libiscsi: add lock around task lists to fix list corruption regression

BugLink: http://bugs.launchpad.net/bugs/1676429
commit 6f8830f5bbab16e54f261de187f3df4644a5b977 upstream.

There's a rather long standing regression from the commit "libiscsi:
Reduce locking contention in fast path"

Depending on iSCSI target behavior, it's possible to hit the case in
iscsi_complete_task where the task is still on a pending list
(!list_empty(&task->running)).  When that happens the task is removed
from the list while holding the session back_lock, but other task list
modification occur under the frwd_lock.  That leads to linked list
corruption and eventually a panicked system.

Rather than back out the session lock split entirely, in order to try
and keep some of the performance gains this patch adds another lock to
maintain the task lists integrity.

Major enterprise supported kernels have been backing out the lock split
for while now, thanks to the efforts at IBM where a lab setup has the
most reliable reproducer I've seen on this issue.  This patch has been
tested there successfully.

Signed-off-by: Chris Leech <cleech@redhat.com>
Fixes: 659743b02c41 ("[SCSI] libiscsi: Reduce locking contention in fast path")
Reported-by: Prashantha Subbarao <psubbara@us.ibm.com>
Reviewed-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/scsi/libiscsi.c
include/scsi/libiscsi.h