Skip to content

Commit aace2b7

Browse files
committed
Merge branch 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-5.17
Pull MD fix from Song: "Please consider pulling the following fix on top of your block-5.17 branch. It fixes a NULL ptr deref case with nowait." * 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: fix NULL pointer deref with nowait but no mddev->queue
2 parents 3e1f941 + 0f9650b commit aace2b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/md/md.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5869,10 +5869,6 @@ int md_run(struct mddev *mddev)
58695869
nowait = nowait && blk_queue_nowait(bdev_get_queue(rdev->bdev));
58705870
}
58715871

5872-
/* Set the NOWAIT flags if all underlying devices support it */
5873-
if (nowait)
5874-
blk_queue_flag_set(QUEUE_FLAG_NOWAIT, mddev->queue);
5875-
58765872
if (!bioset_initialized(&mddev->bio_set)) {
58775873
err = bioset_init(&mddev->bio_set, BIO_POOL_SIZE, 0, BIOSET_NEED_BVECS);
58785874
if (err)
@@ -6010,6 +6006,10 @@ int md_run(struct mddev *mddev)
60106006
else
60116007
blk_queue_flag_clear(QUEUE_FLAG_NONROT, mddev->queue);
60126008
blk_queue_flag_set(QUEUE_FLAG_IO_STAT, mddev->queue);
6009+
6010+
/* Set the NOWAIT flags if all underlying devices support it */
6011+
if (nowait)
6012+
blk_queue_flag_set(QUEUE_FLAG_NOWAIT, mddev->queue);
60136013
}
60146014
if (pers->sync_request) {
60156015
if (mddev->kobj.sd &&

0 commit comments

Comments
 (0)