Skip to content

Commit 4601812

Browse files
hoeppnerjaxboe
authored andcommitted
s390/dasd: Store path configuration data during path handling
Currently, the configuration data for a path is retrieved during a path verification and used only temporarily. If a path is newly added to the I/O setup after a boot, no configuration data will be stored for this particular path. However, this data is required for later use and should be present for a valid I/O path anyway. Store this data during the path verification so that newly added paths can provide all information necessary. [[email protected]: fix conf_data memleak] Signed-off-by: Jan Höppner <[email protected]> Signed-off-by: Stefan Haberland <[email protected]> Reviewed-by: Stefan Haberland <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent d2a5275 commit 4601812

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

drivers/s390/block/dasd_eckd.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,11 @@ static void dasd_eckd_store_conf_data(struct dasd_device *device,
10071007
struct subchannel_id sch_id;
10081008

10091009
ccw_device_get_schid(device->cdev, &sch_id);
1010+
/*
1011+
* path handling and read_conf allocate data
1012+
* free it before replacing the pointer
1013+
*/
1014+
kfree(device->path[chp].conf_data);
10101015
device->path[chp].conf_data = conf_data;
10111016
device->path[chp].cssid = sch_id.cssid;
10121017
device->path[chp].ssid = sch_id.ssid;
@@ -1263,9 +1268,10 @@ static void do_path_verification_work(struct work_struct *work)
12631268
struct dasd_uid *uid;
12641269
__u8 path_rcd_buf[DASD_ECKD_RCD_DATA_SIZE];
12651270
__u8 lpm, opm, npm, ppm, epm, hpfpm, cablepm;
1271+
struct dasd_conf_data *conf_data;
12661272
unsigned long flags;
12671273
char print_uid[60];
1268-
int rc;
1274+
int rc, pos;
12691275

12701276
data = container_of(work, struct path_verification_work_data, worker);
12711277
device = data->device;
@@ -1395,6 +1401,14 @@ static void do_path_verification_work(struct work_struct *work)
13951401
}
13961402
}
13971403

1404+
conf_data = kzalloc(DASD_ECKD_RCD_DATA_SIZE, GFP_KERNEL);
1405+
if (conf_data) {
1406+
memcpy(conf_data, data->rcd_buffer,
1407+
DASD_ECKD_RCD_DATA_SIZE);
1408+
}
1409+
pos = pathmask_to_pos(lpm);
1410+
dasd_eckd_store_conf_data(device, conf_data, pos);
1411+
13981412
/*
13991413
* There is a small chance that a path is lost again between
14001414
* above path verification and the following modification of

0 commit comments

Comments
 (0)