Skip to content

Commit c8d1c0f

Browse files
stefan-haberlandMartin Schwidefsky
authored andcommitted
[S390] dasd: prevent path verification before resume
Mark the device as suspended and delay execution of the path verification worker to prevent mix-up. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 6ffed94 commit c8d1c0f

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎drivers/s390/block/dasd.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,6 +3289,9 @@ int dasd_generic_pm_freeze(struct ccw_device *cdev)
32893289
if (IS_ERR(device))
32903290
return PTR_ERR(device);
32913291

3292+
/* mark device as suspended */
3293+
set_bit(DASD_FLAG_SUSPENDED, &device->flags);
3294+
32923295
if (device->discipline->freeze)
32933296
rc = device->discipline->freeze(device);
32943297

@@ -3363,6 +3366,7 @@ int dasd_generic_restore_device(struct ccw_device *cdev)
33633366
if (device->block)
33643367
dasd_schedule_block_bh(device->block);
33653368

3369+
clear_bit(DASD_FLAG_SUSPENDED, &device->flags);
33663370
dasd_put_device(device);
33673371
return 0;
33683372
}

‎drivers/s390/block/dasd_eckd.c‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,12 @@ static void do_path_verification_work(struct work_struct *work)
11011101
data = container_of(work, struct path_verification_work_data, worker);
11021102
device = data->device;
11031103

1104+
/* delay path verification until device was resumed */
1105+
if (test_bit(DASD_FLAG_SUSPENDED, &device->flags)) {
1106+
schedule_work(work);
1107+
return;
1108+
}
1109+
11041110
opm = 0;
11051111
npm = 0;
11061112
ppm = 0;
@@ -2047,9 +2053,13 @@ static void dasd_eckd_check_for_device_change(struct dasd_device *device,
20472053
/* first of all check for state change pending interrupt */
20482054
mask = DEV_STAT_ATTENTION | DEV_STAT_DEV_END | DEV_STAT_UNIT_EXCEP;
20492055
if ((scsw_dstat(&irb->scsw) & mask) == mask) {
2050-
/* for alias only and not in offline processing*/
2056+
/*
2057+
* for alias only, not in offline processing
2058+
* and only if not suspended
2059+
*/
20512060
if (!device->block && private->lcu &&
2052-
!test_bit(DASD_FLAG_OFFLINE, &device->flags)) {
2061+
!test_bit(DASD_FLAG_OFFLINE, &device->flags) &&
2062+
!test_bit(DASD_FLAG_SUSPENDED, &device->flags)) {
20532063
/*
20542064
* the state change could be caused by an alias
20552065
* reassignment remove device from alias handling

‎drivers/s390/block/dasd_int.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ struct dasd_block {
516516
*/
517517
#define DASD_FLAG_IS_RESERVED 7 /* The device is reserved */
518518
#define DASD_FLAG_LOCK_STOLEN 8 /* The device lock was stolen */
519+
#define DASD_FLAG_SUSPENDED 9 /* The device was suspended */
519520

520521

521522
void dasd_put_device_wake(struct dasd_device *);

0 commit comments

Comments
 (0)