Patch "md: raid1: check rdev before reference in raid1_sync_request func" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    md: raid1: check rdev before reference in raid1_sync_request func

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     md-raid1-check-rdev-before-reference-in-raid1_sync_r.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9b985a08c93dc91440ad5304e66771d0fcd34500
Author: Zhiqiang Liu <liuzhiqiang26@xxxxxxxxxx>
Date:   Tue Dec 10 10:42:25 2019 +0800

    md: raid1: check rdev before reference in raid1_sync_request func
    
    [ Upstream commit 028288df635f5a9addd48ac4677b720192747944 ]
    
    In raid1_sync_request func, rdev should be checked before reference.
    
    Signed-off-by: Zhiqiang Liu <liuzhiqiang26@xxxxxxxxxx>
    Signed-off-by: Song Liu <songliubraving@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index bb29aeefcbd0..c7137f50bd1d 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2781,7 +2781,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
 				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_set_dev(bio, rdev->bdev);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux