s390/cio: fix pgid reserved check
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Fri, 30 Nov 2012 15:48:59 +0000 (16:48 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 3 Jan 2013 03:33:26 +0000 (03:33 +0000)
commitb1beed0d7e3c140862cfbad7cf2a217aa1ff285b
tree5484bae61c5b45fefb10b2fa921a80eb60dc4c74
parent3ce6c59f1e855e3fbcd9599d33ac5b73f38c7c7a
s390/cio: fix pgid reserved check

commit d99e79ec5574fc556c988f613ed6175f6de66f4a upstream.

The check to whom a device is reserved is done by checking the path
state of the affected channel paths. If it turns out that one path is
flagged as reserved by someone else the whole device is marked as such.

However the meaning of the RESVD_ELSE bit is that the addressed device
is reserved to a different pathgroup (and not reserved to a different
LPAR). If we do this test on a path which is currently not a member of
the pathgroup we could erroneously mark the device as reserved to
someone else.

To fix this collect the reserved state for all potential members of the
pathgroup and only mark the device as reserved if all of those potential
members have the RESVD_ELSE bit set.

Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/s390/cio/device_pgid.c