Commit 1b5eaa25 authored by Zhiqiang Liu's avatar Zhiqiang Liu Committed by Khalid Elmously

md: raid1: check rdev before reference in raid1_sync_request func

BugLink: https://bugs.launchpad.net/bugs/1859640

[ Upstream commit 028288df ]

In raid1_sync_request func, rdev should be checked before reference.
Signed-off-by: default avatarZhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 378013b6
......@@ -2630,7 +2630,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
write_targets++;
}
}
if (bio->bi_end_io) {
if (rdev && bio->bi_end_io) {
atomic_inc(&rdev->nr_pending);
bio->bi_iter.bi_sector = sector_nr + rdev->data_offset;
bio->bi_bdev = rdev->bdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment