Skip to content

Commit ef08994

Browse files
heicarstaxboe
authored andcommitted
s390/dasd: hold request queue sysfs lock when calling elevator_init()
"elevator: Fix a race in elevator switching and md device initialization" changed the semantics of elevator_init() in a way that now enforces to hold the corresponding request queue's sysfs_lock when calling elevator_init() to fix a race. The patch did not convert the s390 dasd device driver which is the only device driver which also calls elevator_init(). So add the missing locking. Cc: Tomoki Sekiyama <tomoki.sekiyama@hds.com> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b88fac6 commit ef08994

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/s390/block/dasd.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,12 +2978,12 @@ static int dasd_alloc_queue(struct dasd_block *block)
29782978

29792979
elevator_exit(block->request_queue->elevator);
29802980
block->request_queue->elevator = NULL;
2981+
mutex_lock(&block->request_queue->sysfs_lock);
29812982
rc = elevator_init(block->request_queue, "deadline");
2982-
if (rc) {
2983+
if (rc)
29832984
blk_cleanup_queue(block->request_queue);
2984-
return rc;
2985-
}
2986-
return 0;
2985+
mutex_unlock(&block->request_queue->sysfs_lock);
2986+
return rc;
29872987
}
29882988

29892989
/*

0 commit comments

Comments
 (0)