]> git.itanic.dy.fi Git - linux-stable/commitdiff
s390/dasd: fix missing path conf_data after failed allocation
authorStefan Haberland <sth@linux.ibm.com>
Wed, 20 Oct 2021 11:51:23 +0000 (13:51 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 20 Oct 2021 14:10:42 +0000 (08:10 -0600)
dasd_eckd_path_available_action() does a memory allocation to store
the per path configuration data permanently.
In the unlikely case that this allocation fails there is no conf_data
stored for the corresponding path.

This is OK since this is not necessary for an operational path but some
features like control unit initiated reconfiguration (CUIR) do not work.

To fix this add the path to the 'to be verified pathmask' again and
schedule the handler again.

Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Link: https://lore.kernel.org/r/20211020115124.1735254-7-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/s390/block/dasd_eckd.c

index 6cfaaddb4fbbc8a39bb16a0b11fa64bba133ce53..8410a25a65c139347a6306221593bfb12ff13312 100644 (file)
@@ -1403,6 +1403,14 @@ static void dasd_eckd_path_available_action(struct dasd_device *device,
                if (conf_data) {
                        memcpy(conf_data, data->rcd_buffer,
                               DASD_ECKD_RCD_DATA_SIZE);
+               } else {
+                       /*
+                        * path is operational but path config data could not
+                        * be stored due to low mem condition
+                        * add it to the error path mask and schedule a path
+                        * verification later that this could be added again
+                        */
+                       epm |= lpm;
                }
                pos = pathmask_to_pos(lpm);
                dasd_eckd_store_conf_data(device, conf_data, pos);
@@ -1423,7 +1431,10 @@ static void dasd_eckd_path_available_action(struct dasd_device *device,
                }
                dasd_path_add_nppm(device, npm);
                dasd_path_add_ppm(device, ppm);
-               dasd_path_add_tbvpm(device, epm);
+               if (epm) {
+                       dasd_path_add_tbvpm(device, epm);
+                       dasd_device_set_timer(device, 50);
+               }
                dasd_path_add_cablepm(device, cablepm);
                dasd_path_add_nohpfpm(device, hpfpm);
                spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);