Patch "md/raid1: hold the barrier until handle_read_error() finishes" has been added to the 5.15-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: hold the barrier until handle_read_error() finishes

to the 5.15-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-hold-the-barrier-until-handle_read_error-fi.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 215d4c4f74d212ddcc146e9d26c4f1776f460637
Author: Xueshi Hu <xueshi.hu@xxxxxxxxxx>
Date:   Mon Aug 14 21:53:56 2023 +0800

    md/raid1: hold the barrier until handle_read_error() finishes
    
    [ Upstream commit c069da449a13669ffa754fd971747e7e17e7d691 ]
    
    handle_read_error() will call allow_barrier() to match the former barrier
    raising. However, it should put the allow_barrier() at the end to avoid a
    concurrent raid reshape.
    
    Fixes: 689389a06ce7 ("md/raid1: simplify handle_read_error().")
    Reviewed-by: Yu Kuai <yukuai3@xxxxxxxxxx>
    Signed-off-by: Xueshi Hu <xueshi.hu@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230814135356.1113639-4-xueshi.hu@xxxxxxxxxx
    Signed-off-by: Song Liu <song@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 0e5fd8a524a1d..e8e475b082567 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2484,6 +2484,7 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
 	struct mddev *mddev = conf->mddev;
 	struct bio *bio;
 	struct md_rdev *rdev;
+	sector_t sector;
 
 	clear_bit(R1BIO_ReadError, &r1_bio->state);
 	/* we got a read error. Maybe the drive is bad.  Maybe just
@@ -2513,12 +2514,13 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
 	}
 
 	rdev_dec_pending(rdev, conf->mddev);
-	allow_barrier(conf, r1_bio->sector);
+	sector = r1_bio->sector;
 	bio = r1_bio->master_bio;
 
 	/* Reuse the old r1_bio so that the IO_BLOCKED settings are preserved */
 	r1_bio->state = 0;
 	raid1_read_request(mddev, bio, r1_bio->sectors, r1_bio);
+	allow_barrier(conf, sector);
 }
 
 static void raid1d(struct md_thread *thread)



[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