lp:~fheimes/+git/lp1939618

Owned by Frank Heimes
Get this repository:
git clone https://git.launchpad.net/~fheimes/+git/lp1939618
Only Frank Heimes can upload to this repository. If you are Frank Heimes please log in for upload directions.

Branches

Name Last Modified Last Commit
master-next 2021-08-30 07:13:20 UTC
s390/ap: Fix hanging ioctl caused by wrong msg counter

Author: Harald Freudenberger
Author Date: 2021-06-01 06:27:29 UTC

s390/ap: Fix hanging ioctl caused by wrong msg counter

From: Harald Freudenberger <freude@linux.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1939618

When a AP queue is switched to soft offline, all pending
requests are purged out of the pending requests list and
'received' by the upper layer like zcrypt device drivers.
This is also done for requests which are already enqueued
into the firmware queue. A request in a firmware queue
may eventually produce an response message, but there is
no waiting process any more. However, the response was
counted with the queue_counter and as this counter was
reset to 0 with the offline switch, the pending response
caused the queue_counter to get negative. The next request
increased this counter to 0 (instead of 1) which caused
the ap code to assume there is nothing to receive and so
the response for this valid request was never tried to
fetch from the firmware queue.

This all caused a queue to not work properly after a
switch offline/online and in the end processes to hang
forever when trying to send a crypto request after an
queue offline/online switch cicle.

Fixed by a) making sure the counter does not drop below 0
and b) on a successful enqueue of a message has at least
a value of 1.

Additionally a warning is emitted, when a reply can't get
assigned to a waiting process. This may be normal operation
(process had timeout or has been killed) but may give a
hint that something unexpected happened (like this odd
behavior described above).

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
(cherry picked from commit e73a99f3287a740a07d6618e9470f4d6cb217da8)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>

11 of 1 result
This repository contains Public information 
Everyone can see this information.

Subscribers