OpenCloudOS-Kernel/drivers/s390
Julian Wiedmann c3bfffa5ec scsi: zfcp: Avoid benign overflow of the Request Queue's free-level
zfcp_qdio_send() and zfcp_qdio_int_req() run concurrently, adding and
completing SBALs on the Request Queue. There's a theoretical race where
zfcp_qdio_int_req() completes a number of SBALs & increments the queue's
free-level _before_ zfcp_qdio_send() was able to decrement it.

This can cause ->req_q_free to momentarily hold a value larger than
QDIO_MAX_BUFFERS_PER_Q. Luckily zfcp_qdio_send() is always called under
->req_q_lock, and all readers of the free-level also take this lock. So we
can trust that zfcp_qdio_send() will clean up such a temporary overflow
before anyone can actually observe it.

But it's still confusing and annoying to worry about. So adjust the code to
avoid this race.

Link: https://lore.kernel.org/r/7f61f59a1f8db270312e64644f9173b8f1ac895f.1593780621.git.bblock@linux.ibm.com
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-08 00:50:56 -04:00
..
block s390/dasd: remove ioctl_by_bdev calls 2020-05-21 08:22:20 -06:00
char s390: use fallthrough; 2020-03-25 12:39:37 +01:00
cio vfio-ccw: make vfio_ccw_regops variables declarations static 2020-06-04 13:45:51 +02:00
crypto s390/ap: introduce new ap function ap_get_qdev() 2020-05-20 10:22:51 +02:00
net s390 updates for the 5.8 merge window 2020-06-08 12:05:31 -07:00
scsi scsi: zfcp: Avoid benign overflow of the Request Queue's free-level 2020-07-08 00:50:56 -04:00
virtio virtio/s390: fix race on airq_areas[] 2019-07-26 13:36:18 +02:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00