]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[S390] cio: disallow driver io for known to be broken paths
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Thu, 1 Dec 2011 12:32:20 +0000 (13:32 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 1 Dec 2011 12:32:18 +0000 (13:32 +0100)
When a driver requests to do IO, we will adjust the mask of
paths to be used to exclude varied offline paths.

Drivers trying to do IO solely on paths which are online but some
way defective may lack the information to do proper error handling.

There is no reason to allow the usage of known to be broken paths.
Thus restrict the paths a ccw driver can use for IO to a subset of
the paths cio found usable (this also excludes offline paths).

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/device_ops.c

index f98698d5735e887e0fb6cc46f00a63012ecdccb5..41c21ad0d5f2912523b41a69c1acca803073a794 100644 (file)
@@ -213,9 +213,9 @@ int ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa,
        ret = cio_set_options (sch, flags);
        if (ret)
                return ret;
-       /* Adjust requested path mask to excluded varied off paths. */
+       /* Adjust requested path mask to exclude unusable paths. */
        if (lpm) {
-               lpm &= sch->opm;
+               lpm &= sch->lpm;
                if (lpm == 0)
                        return -EACCES;
        }
@@ -607,9 +607,9 @@ int ccw_device_tm_start_key(struct ccw_device *cdev, struct tcw *tcw,
                return -EINVAL;
        if (cdev->private->state != DEV_STATE_ONLINE)
                return -EIO;
-       /* Adjust requested path mask to excluded varied off paths. */
+       /* Adjust requested path mask to exclude unusable paths. */
        if (lpm) {
-               lpm &= sch->opm;
+               lpm &= sch->lpm;
                if (lpm == 0)
                        return -EACCES;
        }