scsi: zfcp: fix missing erp_lock in port recovery trigger for point-to-point
Steffen Maier authored
commit 819732be upstream.

v2.6.27 commit cc8c2829 ("[SCSI] zfcp: Automatically attach remote
ports") introduced zfcp automatic port scan.

Before that, the user had to use the sysfs attribute "port_add" of an FCP
device (adapter) to add and open remote (target) ports, even for the remote
peer port in point-to-point topology. That code path did a proper port open
recovery trigger taking the erp_lock.

Since above commit, a new helper function zfcp_erp_open_ptp_port()
performed an UNlocked port open recovery trigger. This can race with other
parallel recovery triggers. In zfcp_erp_action_enqueue() this could corrupt
e.g. adapter->erp_total_count or adapter->erp_ready_head.

As already found for fabric topology in v4.17 commit fa89adba ("scsi:
zfcp: fix infinite iteration on ERP ready list"), there was an endless loop
during tracing of rport (un)block.  A subsequent v4.18 commit 9e156c54
...
b1b4ea2f
Name Last commit Last update
Documentation time/namespace: Add max_time_namespaces ucount
LICENSES LICENSES: Rename other to deprecated
arch arm64: dts: allwinner: h5: Fix PMU compatible
block block, bfq: fix use-after-free in bfq_idle_slice_timer_body
certs certs: Add wrapper function to check blacklisted binary hash
crypto crypto: rng - Fix a refcounting bug in crypto_rng_reset()
drivers scsi: zfcp: fix missing erp_lock in port recovery trigger for point-to-point
fs io_uring: honor original task RLIMIT_FSIZE
include xarray: Fix early termination of xas_for_each_marked
init int128: fix __uint128_t compiler test in Kconfig
ipc Revert "ipc,sem: remove uneeded sem_undo_list lock usage in exit_sem()"
kernel sched/core: Remove duplicate assignment in sched_tick_remote()
lib xarray: Fix early termination of xas_for_each_marked
mm mm, memcg: do not high throttle allocators based on wraparound
net Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl
samples Merge tag 'kbuild-v5.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
scripts Merge tag 'devicetree-fixes-for-5.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
security KEYS: reaching the keys quotas correctly
sound ALSA: hda/realtek - Add quirk for MSI GL63
tools xarray: Fix early termination of xas_for_each_marked
usr initramfs: restore default compression behavior
virt Merge tag 'kvmarm-fixes-5.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
.clang-format clang-format: Update with the latest for_each macro list
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl
.gitattributes .gitattributes: use 'dts' diff driver for dts files
.gitignore selftest/lkdtm: Use local .gitignore
.mailmap mailmap: Update email address
COPYING COPYING: state that all contributions really are covered by this file
CREDITS MAINTAINERS: Hand MIPS over to Thomas
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst
MAINTAINERS MAINTAINERS: fix bad file pattern
Makefile Linux 5.6.4
README Drop all 00-INDEX files from Documentation/
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.